2022年7月31日
-
SELECT
`status`,
number,
concat(round(number / total * 100.00, 2), '%') percent
FROM
(
SELECT
*
FROM
(
SELECT
`status`,
COUNT(1) number
FROM
`user_tasks`
GROUP BY
`status`
) t1
INNER JOIN(
SELECT
COUNT(1) total
FROM
`user_tasks`
) t2 ON 1 = 1
) t