What is the difference between Minus and Intersect...
What
is the difference between Minus and Intersect? What is their use in ETL
testing?
Intersect
operation is used to combine two SELECT statements, but it only returns the
records which are common from both SELECT statements.
In
case of Intersect, the number of columns and datatype must be same.
select * from First
INTERSECT
select * from second
Minus
operation combines result of two Select statements and return only those result
which belongs to first set of result. A Minus query looks as follows −
select * from First
MINUS
select * from second
If
you perform source minus target and target minus source, and if the minus query
returns a value, then it should be considered as a case of mismatching rows.
If
the minus query returns a value and the count intersect is less than the source
count or the target table, then the source and target tables contain duplicate
rows.
Comments
Post a Comment