Subject | Re: [ib-support] diference in EXISTS and (ANY and SOME) |
---|---|
Author | Pavel Cisar |
Post date | 2003-04-05T15:21:59Z |
Hi,
On 5 Apr 2003 at 13:05, ronaldorezende wrote:
> What the diference of
> "Using EXISTS"
>
> and
>
> "Using ANY and SOME"
Here is an example of EXISTS predicate...
SELECT * FROM tableA
WHERE EXISTS (select * from tableB WHERE <condition>)
It evaluates to TRUE if subselect returns any row.
ANY and SOME are different, they are used in conjunction with comparison
operators...
SELECT * FROM tableA
WHERE COL1 > ANY (select COLX from tableB WHERE <condition>)
This evaluate to TRUE if COL1 is greater than any value returned by
subselect.
another one...
SELECT * FROM tableA
WHERE COL1 = ANY (select COLX from tableB WHERE <condition>)
This evaluate to TRUE if COL1 is equal than any value returned by
subselect.
Best regards
Pavel Cisar
See you at the First European Firebird Conference in May in Fulda,
Germany
http://www.firebird-conference.com
http://www.ibphoenix.com
For all your upto date Firebird and
InterBase information