📜  如何在 psql 代码示例中使用 except 计数

📅  最后修改于: 2022-03-11 15:05:07.534000             🧑  作者: Mango

代码示例1
# In case you want to count the no. of rows in your psql query which is using except

# let's say this is your original query

SELECT id from table1 except select id from table2;

# to get count do this
select count(*) from (SELECT id from table1 except select id from table2) temp;