mysql当日小计总计sql

database


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;

以上是 mysql当日小计总计sql 的全部内容, 来源链接: utcz.com/z/534833.html

回到顶部