Subject | Re: [firebird-support] SOME or ANY |
---|---|
Author | Helen Borrie |
Post date | 2003-07-02T10:53:30Z |
At 10:10 AM 2/07/2003 +0000, you wrote:
other, according to Jim Melton (who was the editor of the SQL standard).
I can see a semantic trap in this, though.
select * from test where price < any (select price from components
where ...)
doesn't mean "find all rows where price is less than any of the prices in
the subquery". It means "find all rows where price is less than at least
one price in the subquery."
To get the semantic equivalent of the English "less than any" you'd need to use
select * from test where price < all (select price from components
where ...)
and I think min() would be cheaper.
heLen
>Hi Folks,There's no difference. It just "sounds better" to use one rather than the
> I was looking in the Interbase sql reference and noticed that
>firebird supports SOME and ANY in the where clause, ie
>
>select * from test where price < some (select price from components
>where ...)
>and
>select * from test where price < any (select price from components
>where ...)
>
>Whats the difference between SOME and ANY? I've looked on the web
>with no success.
other, according to Jim Melton (who was the editor of the SQL standard).
I can see a semantic trap in this, though.
select * from test where price < any (select price from components
where ...)
doesn't mean "find all rows where price is less than any of the prices in
the subquery". It means "find all rows where price is less than at least
one price in the subquery."
To get the semantic equivalent of the English "less than any" you'd need to use
select * from test where price < all (select price from components
where ...)
and I think min() would be cheaper.
heLen