Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (55.6k points)

Can anyone explain how to use EXCEPT in SQL?

1 Answer

0 votes
by (119k points)
edited by

In SQL, the EXCEPT operator is used to subtracting the result set of the first SELECT statement from the result set of the second SELECT statement. In short, EXCEPT operator return the unique records of first SQL query but not the common records and result set of second select query. EXCEPT is supported in the SQL server but not MySQL.

Here is the syntax to use EXCEPT operator:

SELECT column1, column2,……column

FROM table_name

WHERE condition

EXCEPT

SELECT column1, column2,……column

FROM table_name

WHERE condition;

If you want to learn SQL from Industry experts, I suggest this SQL Certification course by Intellipaat that provides Instructor-led training, hands-on experience, and certification.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jan 5, 2021 in SQL by Appu (6.1k points)
0 votes
1 answer
0 votes
1 answer
asked May 4, 2020 in SQL by Sudhir_1997 (55.6k points)
0 votes
1 answer
asked May 4, 2020 in SQL by Sudhir_1997 (55.6k points)

Browse Categories

...