Hi,
I know this is such a basic question, but for the life of me I cannot recall what I did in the past.
I have a SELECT statement that does:
SELECT * FROM mytable WHERE area = 'area1' OR 'area2'
Now that's fine. However, I only want to display all entries which are listed under area1 & area2, IF the region is region1 or region2.
i.e: SELECT * FROM mytable WHERE area = 'area1' OR 'area2' IF region = 'region1' OR 'region2'
Trouble is, I can't recall the syntax, nor find it on mysql.com, and IF doesn't seem to work, nor does a second WHERE or HAVING.
Can anyone recall the syntax I need for this? It has to be watertight - it must ONLY display those results within those areas IF within those regions.
TIA for any help,
Jonathen