i have a very large DB. I need to run a query to search by email and load_date (date/timestamped field). I need to pull 3 email users from 3 different dates.
So I need a single table to display the emails (email field):
[email protected] [email protected] finalemail.yosite.com for the dates (load_date field):
2014-08-01 2014-08-06 2014-08-09 If i run this:
SELECT email, load_date FROM table1 WHERE email = '[email protected]' or email = '[email protected]' or email = 'finalemail.yosite.com The results are correct.
If i run:
SELECT email, load_date FROM table1 WHERE load_date LIKE "2014-08-01%" or load_date LIKE "2014-08-06%" or load_date LIKE "2014-08-09%" The results are correct.
But if i combine them:
SELECT email, load_date FROM table1 WHERE email = '[email protected]' or email = '[email protected]' or email = 'finalemail.yosite.com' and load_date LIKE "2014-08-01%" or load_date LIKE "2014-08-6%" or load_date LIKE "2014-08-09%" I get everything!?
What am i doing wrong??