|
Ok I think I've almost got it.
I need a way though to specify WHERE (month !=12 AND year !=2004) .....anyone ???
ie.
month=5, year=2004 * should come up
month=12, year=2002 * should come up
month=12, year=2004 * shouldn't come up
Right now using WHERE (month !=12 AND year !=2004), none of the above return rows.
If I can get the above into a $where, the other query will work like this:
SELECT t1.campaign_id, t2.revenue FROM table1 t1 LEFT JOIN table2 t2 ON t1.campaign_id=t2.campaign_id WHERE t1.uid=851 AND ((t2.year=2004 AND t2.month=12) OR t2.campaign_id IS NULL OR $where)
|