Friday, July 13, 2012

EXCEPT and INTERSECT

Except - It returns data from left side query expression that is not in the data by right side query expression.
Ex.
A - data that is not in right side query result
B - data that is not in left side query result
C - data that is common in both results

Except returns A.
 

Intersect
- It returns data that is common in left and right side query expressions.
Intersect returns C.

Syntax -
{ <query_specification> | ( <query_expression> ) } 
{ EXCEPT | INTERSECT }
{ <query_specification> | ( <query_expression> ) }

No comments:

Post a Comment

CI/CD - Safe DB Changes/Migrations

Safe DB Migrations means updating your database schema without breaking the running application and without downtime . In real systems (A...