There are two tables tableA and tableB and I need a complement of tableA with tableB , I mean, I want to return all the rows which are absents in tableB, like
Here "tableA COMPLEMENT tableB" results into following rows,
My first try,
Its working , but I'm not sure whether its good or not !
So any alternatives??
I think operations like "Union", "Minus", "Intersect" are standard Relational Operations that all databases should adhere to.
not sure why SQL Server doesn't support this.
Rahul Babbar wrote:I think operations like "Union", "Minus", "Intersect" are standard Relational Operations that all databases should adhere to.
not sure why SQL Server doesn't support this.
Yes, we checked out this basic set operation first, But SQL SERVER dosen't supports MINUS (Yeh, Its support UNION and INTERSECTION). Actually there in no keyword like, minus. And interestingly doesn't have CONCAT operator (Query is constructed on MySQL first) too.
Some database use an alternate keyword for "minus." For example, db2 uses "except." I did check online and SQL Server doesn't have one. Which means this post isn't so much for you as it is for the db2 user who stumbles across this thread.