根据>80
的说法,我有桌子,我只想在U1
之前使用列。
T1:
User || C1 || C2 || C3 || C4 || C5 || Total
U1 || 10 || 20 || 15 || 40 || 15 || 100
U2 || 27 || 17 || 8 || 23 || 25 || 100
我寻找的答案是这样的表格:
P1:
User || C2 || C3 || C4 || C5
U1 || 20 || 15 || 40 || 15
U2 || 17 || 8 || 23 || 25
答案 0 :(得分:1)
SELECT *, C1+C2+C3+C4+C5 AS total
FROM t1
WHERE C1+C2+C3+C4+C5 > 80