10金币
最佳答案-- 创建视图的SQL语句
CREATE VIEW v_UserTaskStatus AS
SELECT
[姓名] AS Name,
SUM(CASE WHEN [进度] = N'进行中' THEN 1 ELSE 0 END) AS [进行中],
SUM(CASE WHEN [进度] = N'已暂停' THEN 1 ELSE 0 END) AS [已暂停],
SUM(CASE WHEN [进度] = N'已完成' THEN 1 ELSE 0 END) AS [已完成]
FROM
YourTableName -- 请用实际的表名替换 "YourTableName"
GROUP BY
[姓名];
| |
| |