get the SUM of each Person by the PersonID

后端 未结 4 1046
南笙
南笙 2021-01-24 10:11

I have the following columns in a table:

SCORE_ID 
SCORE_PERSON_ID 
SCORE_VOTE

The SCORE_PERSON_ID is a variable. I need to sum the SCORE_VOTE

4条回答
  •  梦毁少年i
    2021-01-24 10:49

    how about

    select sum(SCORE_VOTE) as score  from TABLE group by SCORE_PERSON_ID 
    

    this is sum them up for each person

    select sum(SCORE_VOTE)  as score  from TABLE where SCORE_PERSON_ID = 1
    

提交回复
热议问题