What is use of except clause? How does it differ from not in clause?



What is use of except clause? How does it differ from not in clause?..

Answer / Ankush Gupta

The EXCEPT clause in SQL Server is used to exclude rows that appear in the right query, but not in the left query. In other words, it returns only the differences between two result sets. The NOT IN operator also compares rows from one table with another, but it does not require the exact order of the results.nnExample: Using EXCEPT:nSELECT ProductID FROM Orders WHERE ProductID NOT EXISTS (SELECT ProductID FROM OrderDetails);nExample using NOT IN:nSELECT * FROM Customers WHERE CustomerID NOT IN (SELECT CustomerID FROM Orders)

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What is the architecture of ms sql reporting service?

1 Answers  


Explain mixed authentication mode of sql server?

1 Answers  


What is dynamic cursor in SQL SERVER?

1 Answers  


What is sub-query in sql server? Explain its properties.

1 Answers  


What is a schema in ms sql server 2005?

1 Answers  


How will you monitor replication activity and performance? What privilege do you need to use replication monitor? : sql server replication

1 Answers  


In join, which clause in not used?

4 Answers   HCL, NIIT, TCS,


A user is a member of the public role and the sales role. The public role has select permission on all the tables. The sales role does not have select permission on some of the tables will the user be able to select from all tables?

1 Answers  


what is the difference between table and view

1 Answers  


Rate yourself in .NET and SQL ?

1 Answers   Cognizant, HCL, SunGard,


What are the different SQL Server Versions you have worked on?

0 Answers  


Is sql server is free?

1 Answers  


Categories