Monday, May 12, 2008

diiference between Except and Intersect in sql server 2005?

Returns distinct values by comparing the results of two queries.
EXCEPT returns any distinct values from the left query that are not also found on the right query.
INTERSECT returns any distinct values that are returned by both the query on the left and right sides of the INTERSECT operand.
The basic rules for combining the result sets of two queries that use EXCEPT or INTERSECT are the following:
The number and the order of the columns must be the same in all queries.
The data types must be compatible.

No comments: