Quote:
Originally posted by Varius
Thanks!! This works, but now I have a final argument for the WHERE clause to add that's not working.
table1 also has this field:
uid int unsigned not null key
So how can I get the above, matching UID as well?
I tried this:
SELECT t1.campaign_id, t2.revenue FROM table1 t1 LEFT JOIN table2 t2 ON t1.campaign_id=t2.campaign_id WHERE ((t2.year=2004 AND t2.month=12) OR t2.campaign_id IS NULL) AND t1.uid=851
however it only returns me the rows from table1 which are NOT in table2.
|
SELECT t1.campaign_id, t2.revenue FROM table1 t1 LEFT JOIN table2 t2 ON t1.campaign_id=t2.campaign_id WHERE (t2.year=2004 AND t2.month=12 AND t1.uid=851) OR t2.campaign_id IS NULL