Hi I have query that confusing, this is the query
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
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
Anyone can help me?