Hi,
which one will be faster( i have tested it , i wanted to know in general)
1)
select *
from abc drr
LEFT JOIN (SELECT bridgeid
FROM bridge1 SS
WHERE SS.Status=1
UNION
SELECT bridgeid FROM bridge2) L
ON l.bridgeid = drr.bridgeid
2)
2)
select *,
case drr.frombridg1 when 1 then
(select bridgeid from bridge1 where Status=1 and bridgeid = drr.bridgeid )
else (select bridgeid from bridge2 where Status=1 and bridgeid = drr.bridgeid and status=1)
end
from abc drr
yours sincerly