Subject Re: [ib-support] Re: DEAD LOCK ON SQL
Author Svein Erling Tysvær
>The logic of this is not the same as the correlated subselect:
>
>select...where mine.col1 in (select yours.colx from yours where something
>of mine matches something of yours)

Yes, it is (at least if written correctly).

I tried something like

SELECT NAME
FROM ib-support ib
WHERE EXISTS(SELECT 1
FROM ibobjects ibo
WHERE ib.surname = ibo.surname
AND ibo.signature = 'heLen')

and the only row that was returned was "Helen Borrie", not all the names in
ib-support (OK, so I did it on some data containing cancers and hospitals,
but Norwegian column names doesn't make sense to most of you so I
"translated" it). The exists is executed once for every potential row to
return - at least when there is a link in the where clause of the subselect.

>nor is the same as the join statement:
>
>select...
>from mine join yours
> on mine.col1 = yours.colx

Just included this to say that I completely agree with you regarding this
statement! ;o}

Set
-a little puppy fighting the big (kan)guru