Just learned about these from the article "SQL Server All, Some and Any Operators" in the website www.blackwasp.co.uk. Though these things are basic, its worthy to remember again.
The SOME and ANY operators provide equivalent functionality. SOME and ANY operators return true if at least one of the generated values from the inner expression satisfies the specified condition, Where as with ALL operator, it return true if all the generated values from the inner expression satisfies the specified condition
<pre class="brush: plain"> declare @Emps table (EmpId int,Sal int) insert into @Emps values (1,100),(2,120),(3,150),(4,200) -- Any Returns Top most emp salary select * from @Emps where Sal >= ALL(select Sal from @Emps) -- All Returns Employees except Top most salary select * from @Emps where Sal < ANY(select Sal from @Emps) </pre> </pre>
Published under: SQL Server Tips · · · ·
This is part of the ANSI standard, which has been documented very well in the "SAMS: Teach Yourself SQL in 24 hours", 5th edition, reviewed by me here: http://beyondrelational.com/blogs/nakul/archive/2011/07/07/book-review-sams-teach-yourself-sql-in-24-hours-5th-edition.aspx
I like Brad Schulz blog on this topic http://bradsruminations.blogspot.com/2009/08/all-any-and-some-three-stooges.html