【发布时间】:2015-12-09 18:46:43
【问题描述】:
我被查询困住了。基本上我想根据两个where子句获得同一字段的两个结果。 当 (ins_n = 0) 时求和 (field1),当 (ins_n = 1) 时求和 (field1)。我希望我解释了。现在我只能在 (ins_n = 0) 时这样做
"SELECT " +
"SUM(field1) AS incasso1, " +
"FROM Movimentinegozio WHERE ins_n = 0 ";
【问题讨论】:
-
select ... where ins_n in (0, 1) group by ins_n?