title: On union with NULL, rows are repeating
body: <p>I have a sql query, in which I have joined two columns using Union including null.
  Here is my query :</p>
  <pre><code>select users.id, 
  users.name, 
  users.email, 
  users.image, 
  users.created_at, 
  users.is_online, 
  friends.user_id, 
  friends.friend_id, 
  friends.accept from users left join friends on users.id=friends.friend_id 
  where users.id != 18 and (friends.user_id = 18 or friends.user_id is NULL) 
  UNION 
  select users.id, 
  users.name, 
  users.email, 
  users.image, 
  users.created_at, 
  users.is_online, 
  friends.user_id, 
  friends.friend_id, 
  friends.accept from users left join friends on users.id=friends.user_id 
  where users.id != 18 and (friends.friend_id = 18 or friends.friend_id is NULL) 
  order by id asc 
  </code></pre>
  <p>Its working fine but its repeating the rows in case 1 column contains the value and other is null, I just want to remove the null value containing row,</p>
  <pre><code> id |  created_at |    name     |        email               |      image      | is_online | user_id | friend_id | accept 
   ------------+------------+----------------------+-----------------+-----------+-------------+-----------+-------------
    1 |  2020-03-24 | yashyashwi  | yashyashwi@gmail.com       | 1596540233.jpeg | 0         |      18 |         2 |  0 
    4 |  2020-03-25 | Jesly Benny | benny@gmail.com            | 1596540244.jpeg | 0         |      18 |      4    |  2 
    4 |  2020-03-26 | Jesly Benny | benny@gmail.com            | 1596540334.jpeg | 0         |    NULL |      NULL |  NULL 
    5 |  2020-03-27 | Zasika      | Zasika@gmail.com           | 1596540334.jpeg | 0         |      5  |        18 |  0 
  
  </code></pre>
  <p>Please help me out</p>