title: mysql group by ignore null
body: <p>I have a table given below</p>
  
  <pre>
  id     album_id   album_name
  ----   ---------  -----------
  1          5         test1
  2          5         test1
  3          6         test3
  4          6         test3
  5          NULL      test4
  6          NULL      test4
  </pre>
  
  <p>I want to write a query using group by album_id , it will give below result</p>
  
  <pre>
  id     album_id   album_name
  ----   ---------  -----------
  1          5         test1
  3          6         test3
  5          NULL      test4
  6          NULL      test4
  </pre>
  
  <p>I have tried but its grouping NULL column also, I want all the rows which are NULL and group by album_id which are not null.</p>
  
  <p>I have followed this <a href="https://stackoverflow.com/questions/19096344/can-you-group-by-with-a-case-when-then-alias-name">link</a> - but don't work for me</p>
  
  <p>Thanks</p>