当 qty 大于零时的条件 where 子句

conditional where clause when qty is greater than zero

我有一个名为 Bin_ID 的字段,其中包含三个不同的项目 Bin ID。

Bin_id = Red
Bin_id = Blue
Bin_id= Green 

还有一个字段叫Unit_quantity

我想在我的 where 子句中添加以下逻辑:如果 Bin_ID green 的 unit_qty 大于零,那么我想将其从我的结果中删除。

我该怎么做?

提前致谢!

您可以使用 not 和括号中的条件。

where not (Bin_ID = 'Green' and unit_qty > 0)