I have run this query make a more time please any body optimize this query as blew
$sql=“SELECT f.feeder_code, f.subdivision_code FROM feeder
f, sentout s
where ( f.start_date <= ‘2008-07-01’ and f.end_date >= ‘2008-07-01’ and
(s.month = 7 and s.year = 8 )) and f.feeder_code = s.feeder_code
UNION
SELECT feeder_code, subdivision_code FROM ht WHERE ht.month = 7 and
ht.year = 8 and concat( feeder_code, subdivision_code ) NOT IN
(SELECT concat( f.feeder_code, f.subdivision_code )
FROM feeder
f, sentout s where (f.start_date <= ‘2008-07-01’ and f.end_date >=‘2008-07-01’ and (s.month = 7 and s.year = 8)) and f.feeder_code = s.feeder_code)
UNION
SELECT feeder_code, subdivision_code FROM lt WHERE lt.month = 7
and lt.year = 8 and concat( feeder_code, subdivision_code ) NOT IN
( SELECT concat( f.feeder_code, f.subdivision_code ) FROM feeder f, sentout s
where (f.start_date<= ‘2008-07-01’ and f.end_date >= ‘2008-07-01’ and
(s.month = 7 and s.year = 8)) and f.feeder_code = s.feeder_code
) AND concat( feeder_code, subdivision_code ) NOT IN ( SELECT concat( feeder_Code, subdivision_code )
FROM ht WHERE ht.month = 7 and ht.year = 8)
ORDER BY feeder_code, subdivision_code”;
solved this problem because this take a more time