Intersect operator
The intersect operator retrieves the common records between the left and right queries of the intersect operator.
1) This is introduced in SQL Server 2005.
2) The number of columns and order of columns should be the same.
3) The data types must be the same or least compatible.
4) It filters duplicate records and selects only distinct records that are common in the left and right queries. But if you use inner join then it will not filter distinct...
Learn to use Union, Intersect, and Except Clauses
The intersect operator retrieves the common records between the left and right queries of the intersect operator.
1) This is introduced in SQL Server 2005.
2) The number of columns and order of columns should be the same.
3) The data types must be the same or least compatible.
4) It filters duplicate records and selects only distinct records that are common in the left and right queries. But if you use inner join then it will not filter distinct...
Learn to use Union, Intersect, and Except Clauses