SQL query - combining AND and OR
I am just tweaking a page here:
http://www.goodsafariguide.net/africanhorseback/index102.php
Basically just changing the nominations history part to just show nominations from 2013 and 2011, as some of the palces had too long a list of nominations.
So the original SQL query was:
SELECT NominationID, Category, Year, Finalist, Winner, LodgeID FROM nominations WHERE LodgeID = 288 ORDER BY Year DESC, CATEGORY ASC
So I want it to now display nominations for that LodgeID, but just for 2011 and 2013, which I thought should just be:
SELECT NominationID, Category, Year, Finalist, Winner, LodgeID FROM nominations WHERE LodgeID = 288 AND (Year='2013' OR '2011') ORDER BY Year DESC, CATEGORY ASC
But that isn't working. I've tried a few variations, with and without the inverted commas, but can't seem to get it.
Any suggestions?
