我需要为 Postgres 表中的同一列设置两个条件。
例如这里有两个查询:
select * from product_table where color = 'red';
select * from product_table where color is NULL;
如何在单个查询中完成此操作?
最佳答案
This is better
select * from product_table where (color = 'red' OR color is null);
关于sql - 同一列的多个条件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42900602/