-
Website
http://awads.net/wp/ -
Original page
http://awads.net/wp/2005/08/09/any-some-and-all-in-oracle/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
jgarry
3 comments · 1 points
-
Andy C
22 comments · 47 points
-
dahowlett
1 comment · 2 points
-
Don Seiler
9 comments · 1 points
-
davidhaimes
4 comments · 3 points
-
-
Popular Threads
Since the query optimizer changes these to more traditional queries, I wonder why these keywords exist.
I imagine it was to some community of people to write their queries in a way that was more comfortable or understandable for them.
If so, I wonder in which database or language these key words have their origin.
What do you think?
Maybe you're right. Maybe Oracle introduced these comparison operators just because other databases have it, I do not know. I do know however that SQL Server has similar [ANY/SOME](http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_setu-sus_17jt.asp) and [ALL](http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_aa-az_2fsc.asp) operators. I still want to prove that using ANY, for example, is slower than using >, < or = instead. I'll put it on my to-do list.
Nice post, however I believe these operators make less readable a given query.
Very very descriptive and useful... Hats Off...
SELECT *
FROM emp
WHERE sal >=800 AND sal >=null;
This query can return rows. Why?
SELECT *
FROM emp
WHERE sal >=null;
This query can not return rows. Why?
What is the meaning of the following query?
SELECT *
FROM emp
WHERE NOT manager_id <> ALL(800,1600,null);
anguang,
sal >=nullis meaningless. It's eithersal is nullorsal is not null.Really it is very nice post , It clear my confusion between any and some.
i want to details of that manager who have reported maximum no. of employees.........from emp table.
Hats Off
Thanks
SELECT *
FROM emp
WHERE sal >=800 AND sal >=null;
This query can return rows. Why?
Optimization, as you can see with explain plan.
My guess: 800 is sorted higher as Null, so we'll only test sal >=800.
Interesting question though.
Jan