Reputation: 2317
I am having problems with the following statement.
SELECT * FROM favorites WHERE personID = 1 HAVING category = "Music"
I am trying to get all the items of Category "Music" where there is "personID" of 1.
Thanks for your help.
Upvotes: 0
Views: 82
Reputation: 30765
As already mentioned by SeventotheSeven, you cannot use HAVING without a GROUP BY.
From your question, I guess you really need a simple AND:
SELECT * FROM favorites
WHERE personID = 1
AND category = 'Music'
Please also note that SQL uses single quotes around strings, not double quotes.
Upvotes: 4