In today’s article, we will learn how to use the PostgreSQL EXCEPT operator to return the rows in the first query that do not appear in the output of the second query.
Syntax:
1 |
Select column1,column2 from table_1 |
EXCEPT:
1 |
Select column1,column2 from table_2 |
First, let’s see our tables and the data in them.
The columns and data of the Müsteriler and Personel table are as above.
Let’s understand the except command by giving an example.
1 2 3 |
select "Adi_Soyadi","İl" from "Müsteriler" EXCEPT select "Adi_soyadi","Sehir" from "Personel" |