Subject Re: [firebird-support] avoid query subselect
Author Mr. John
indeed much better

thanks!


On Friday, July 19, 2019, 02:34:20 PM GMT+3, liviuslivius liviuslivius@... [firebird-support] <firebird-support@yahoogroups.com> wrote:


 

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