📅  最后修改于: 2022-03-11 15:04:53.805000             🧑  作者: Mango
SET @total = (
SELECT COUNT(id_gest_dossier)
FROM t_users_dossiers);
SELECT id_user,
COUNT(id_gest_dossier),
ROUND(COUNT(id_gest_dossier)/@total*100,3) AS '%'
FROM t_users_dossiers
GROUP BY id_user;