Hereís my problem , hopefully simplified. Have two tables. Table one contains a list of music genres(only my table has 3,000 types) Table two contains a lift of albums. I only want to select a genre that has 5 or more albums.
My attempt so far has been to break the problem into simpler parts, iterating through the Genre table, then performing another query to see if the number of albums for each Genre is greater than 5. As you can imagine this is painfully slow. Iíve had few attempts but only succeeded in locking up my machine :).
If someone could help with problem it would be appreciated. Many thanks
For anyone else reading this thread, HAVING essentially lets you do a WHERE clause after the GROUP BY has aggregated your data. So you can limit queries by min(), max(), count(), etc., which WHERE cannot do.