Getting Started with Adobe After Effects - Part 6: Motion Blur
A collection of quick technology learning tips from what people around you learn every day

SOME and ANY in TSQL

Aug 17 2011 9:24AM by Robert Dennyson   

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 &gt;= ALL(select Sal from @Emps)
        -- All Returns Employees except Top most salary
        select * from @Emps where Sal &lt; ANY(select Sal from @Emps)
        </pre>

</pre>
Read More..   [12 clicks]

Published under: SQL Server Tips ·  ·  ·  · 


Robert Dennyson
11 · 14% · 4420
19
 
4
 
16
 
0
Incorrect
 
0
Interesting
 
0
Forgotten



Submit

2  Comments  

  • commented on Sep 6 2011 10:34PM
    Naomi
    33 · 6% · 1774

Your Comment


Sign Up or Login to post a comment.

"SOME and ANY in TSQL" rated 5 out of 5 by 19 readers
SOME and ANY in TSQL , 5.0 out of 5 based on 19 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]