https://i.stack.imgur.com/8otLv.jpg
我想选择名字 当sum(Productivity)> = 3000和Date =' 2017-12-25' 按机器分组
答案 0 :(得分:3)
GROUP BY
与SUM
一起使用HAVING
:
SELECT
names,
Machines
FROM Table1
where Date = '2017-12-25'
group by names, Machines
HAVING sum(Productivity) >= 3000;