我想在多列中添加一行的值作为列
No Name Requested Reported Finished
1 Ali 4 4 1
2 Amina 10 5 2
As
No Name Requested Reported Finished Total
1 Ali 4 4 1 9
2 Amina 10 5 2 17
答案 0 :(得分:0)
使用SUM
功能。
SELECT no,Name,requested,reported,finished,
SUM(requested+reported+finished) AS Total
FROM tbl
GROUP BY no,Name,requested,reported,finished;
答案 1 :(得分:0)
SELECT no,
Name,
requested,
reported,
finished,
Isnull(requested, 0) + Isnull(reported, 0) + Isnull(finished, 0) AS Total
FROM tbl