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

SQL Server - INTERSECT and EXCEPT

Nov 19 2011 2:15PM by Deepak kelath   

'EXCEPT' will show any distinct value from first query result that is not found in second query result.

Select itemid from itemmaster except Select itemid from stock

'INTERSECT' will show any distinct values, which are common in both first & second query results.

Select itemid from itemmaster intersect Select itemid from stock

The datatype and no of columns should be same in all the queries.

Read More..   [0 clicks]

Published under: SQL Server Tips ·  ·  ·  · 


Deepak kelath
210 · 1% · 222
13
 
12
 
 
0
Incorrect
 
0
Interesting
 
0
Forgotten



Submit

4  Comments  

  • What versions of sql does this apply to.

    commented on Nov 21 2011 7:28AM
    mbova407
    322 · 0% · 132
  • i checked in 2008 enterprise edition, may be in 2005 also.

    commented on Nov 21 2011 7:50AM
    Deepak kelath
    210 · 1% · 222
  • Yep, it works on 2005.

    commented on Nov 21 2011 8:11AM
    Adam Tokarski
    58 · 3% · 1021
  • Yes it is available for 2005 and later version. good post Deepak

    commented on Nov 22 2011 1:41AM
    Shivendra Kumar Yadav
    60 · 3% · 936

Your Comment


Sign Up or Login to post a comment.

"SQL Server - INTERSECT and EXCEPT " rated 5 out of 5 by 13 readers
SQL Server - INTERSECT and EXCEPT , 5.0 out of 5 based on 13 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]