It's been so long since I've SQL it's jumped right out of my head - nothing like riding a bike 🙂
Anyway, what I am trying to do is list two columns in a table. I want to COUNT the number of items in each category (link_cat_fk). The code here does it perfectly:
SELECT link_cat_fk, COUNT(link_cat_fk) as Cnt FROM tbl_links GROUP BY link_cat_fk ORDER BY Cnt DESC
But what I want to do is ONLY include this when the count is greater than zero! It seems I can't put a WHERE anywhere in there without generating an error of some sort. Logically want I want is somthing like:
WHERE Cnt > 0
hehehehe, but, you guessed it, it doesn't work.
Any help please!