SELECT
date(a.createTime) as `day`,
a.userId,
a.nickname,
sum(a.costDiamond) as num
FROM
niuniu_game_result_log a
GROUP BY `day`, a.userId
having sum(a.costDiamond) > 0;
mysql where 后面如果有sum
最新推荐文章于 2024-06-09 10:15:00 发布
SELECT
date(a.createTime) as `day`,
a.userId,
a.nickname,
sum(a.costDiamond) as num
FROM
niuniu_game_result_log a
GROUP BY `day`, a.userId
having sum(a.costDiamond) > 0;