SELECT create_time, total1 as "小计", @total := @total + total1 AS "总计" FROM ( SELECT
SELECT
create_time,
total1 as "小计",
@total := @total + total1 AS "总计"
FROM
(
SELECT
date(create_time) AS create_time,
sum(1) AS total1
FROM
sys_wx_user
GROUP BY
date(create_time)
) AS temp,
(SELECT @total := 0) AS T1
ORDER BY
create_time;
--结束END--
本文标题: mysql 当日小计 总计sql
本文链接: https://lsjlt.com/news/7465.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0