I have a sql table with a user_id
and an integer
Is it possible to select integer
from table where user_id
= ?
then add all integer results together and return just the one integer result?
答案 0 :(得分:2)
yes - try something along of the lines of:
SELECT SUM(integer) FROM tbl WHERE user_id = 'xxx'
答案 1 :(得分:2)
You could do something like
SELECT sum(integer) As ReturnValue
FROM table
WHERE user_id = [value]