Subject Re: [firebird-support] avoid query subselect
Author liviuslivius
Hi,
 
i suppose this one is much faster
 
SELECT P.ID
, CASE WHEN EXISTS(SELECT * FROM  CHILD C WHERE C.ID_PARENT=P.ID AND C.MYFIELD=3)
 
THEN 1 ELSE 0 END AS ISDATA
  FROM PARENT P
...........
INNER JOIN TABLE3 T3 ON P.ID=T3.....
INNER JOIN TABLE3 T4 ON P.ID=T4.....
..........
 
 
Regards,
Karol Biieniaszewski