Friday, 6 September 2013

fetching datas from two tables satisfying the where condition

fetching datas from two tables satisfying the where condition

I have a doubt.can I do the following two queries in one query itself??
SELECT id FROM table1 WHERE time_stamp>=DATE_SUB(NOW(),INTERVAL 10 MINUTE)
AND status<>200 ORDER BY time_stamp ASC LIMIT 2 "
andSELECT email FROM table2 WHERE wid='".$xy."'" where $xy is the id
fetched from first select query.

No comments:

Post a Comment