I am selecting records from two tables:
select a.fileid, a.outby, a.adddate, b.email from table1 a, table2 b where a.outby=b.uid and a.adddate < date_add(now(), interval -6 day) and a.status in (1,2) UNION
select a.fileid, a.outby, a.adddate, b.email from table3 a, table2 b where...