title: How to set IF statement on GROUP BY
body: <p>Hi I have query that confusing, this is the query</p>
  
  <pre><code>SELECT meta_value, meta_count, post_id
  FROM wp_post_meta
  GROUP BY IF(ISNULL(target_key), '', target_key) 
  ORDER BY `meta_count` DESC 
  LIMIT 30
  </code></pre>
  
  <p>Some of target key is null but some is value exist, how can I make result if target_key is value exist make it GROUP BY but if empty GROUP BY disabled</p>
  
  <p>Anyone can help me?</p>