Subject | Re: Again Sub-Query Problem |
---|---|
Author | Svein Erling |
Post date | 2003-11-18T10:49:23Z |
--- In firebird-support@yahoogroups.com, Uwe Oeder <uweo@c...> wrote:
separate EXISTS, and you cannot reference it outside of that EXISTS.
I.e.
SELECT * FROM A WHERE EXISTS(SELECT * FROM B WHERE B.A_ID = A.ID AND
EXISTS (SELECT * FROM C WHERE C.B_ID = B.ID))
is legal, whereas
SELECT * FROM A WHERE EXISTS(SELECT * FROM B WHERE B.A_ID = A.ID) AND
EXISTS (SELECT * FROM C WHERE C.B_ID = B.ID)
(equivalent to what you wrote) is illegal.
Though I still think you should clean up your SQL if you want to get
useful results.
Set
> Please tell me this is also a very simple problem.Uwe, as you can see from the extract above W2 is declared in a
>
> SELECT <something>
> FROM Whitepage W3 ...
> WHERE ...
> AND
> EXISTS
> (
> SELECT <something>
> FROM Whitepage W2 ...
> )
> AND
> EXISTS
> (
> SELECT <something>
> FROM Whitepage W1
> WHERE ...
> AND
> W1.WpIDSQ = W2.WpIDSQ
> ) ;
separate EXISTS, and you cannot reference it outside of that EXISTS.
I.e.
SELECT * FROM A WHERE EXISTS(SELECT * FROM B WHERE B.A_ID = A.ID AND
EXISTS (SELECT * FROM C WHERE C.B_ID = B.ID))
is legal, whereas
SELECT * FROM A WHERE EXISTS(SELECT * FROM B WHERE B.A_ID = A.ID) AND
EXISTS (SELECT * FROM C WHERE C.B_ID = B.ID)
(equivalent to what you wrote) is illegal.
Though I still think you should clean up your SQL if you want to get
useful results.
Set