What is Except Operator?



To find rows in one set that do not exist in another set, use the except operator (as defined in SQL-92 and SQL-99). For example, here’s how you find column1 from Table1 that does not exist in column2 of Table2:

Select column1 from Table1 Except Select column2 from Table2; The except operator will remove duplicates, and a single null value will be returned in the case of multiple null values. To return duplicates, use except all. Keep in mind, of course, that other proprietary implementations (such as Minus in Oracle) exist.



Leave a Reply