Subject RE: [ib-support] Re: DEAD LOCK ON SQL
Author Burak OZLER
Thanks for your help...

Has anyone at developing team has any plan to correct this...

Burak �ZLER
���nc� Bilgisayar
MagicSoft
+90 232 464 89 33 / 123


-----Original Message-----
From: iananewby [mailto:ian@...]
Sent: Tuesday, June 11, 2002 6:57 PM
To: ib-support@yahoogroups.com
Subject: [ib-support] Re: DEAD LOCK ON SQL

Hi Burak,
Firebird is poor at dealing with sub-selects. Basically the sub
select fires for every record in the main table. Two alternatives
are as follows:

Use EXISTS in place of IN

SELECT U.URUN_KUTUK_ID
, U.CARIID
, U.MARKAID
, U.URUN_KOD
, U.URUN_AD_TR
, U.URUN_AD_EN
, U.GTIP
FROM URUN_KUTUK U
WHERE URUN_KOD EXIST
(SELECT I.GM_PART_NUMBER
FROM INVOICE_DETAIL I
WHERE I.INVOICE_MASTER_ID=437 and I.GM_PART_NUMBER = U.URUN_KOD)

Or use joins

SELECT U.URUN_KUTUK_ID
, U.CARIID
, U.MARKAID
, U.URUN_KOD
, U.URUN_AD_TR
, U.URUN_AD_EN
, U.GTIP
FROM URN_KUTUK U
JOIN INVOICE_DETAIL I
ON I.GM_PART_NUMBER = U.URUN_KOD
WHERE I.INVOICE_MASTER_ID=437

Hope that helps

Ian Newby




To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com



Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/