how to calculate unique column values in mysql

前端 未结 2 1091
粉色の甜心
粉色の甜心 2021-01-25 01:57

Here is my data

cardNo| userName| tablename| hours |  date 
1     |  a      |    a     |   12  |  12-06-2015 
1     |  a      |    a     |    5  |  11-06-2015 
2         


        
2条回答
  •  鱼传尺愫
    2021-01-25 02:38

    SELECT cardNo,userName, tablename, sum(hours) hours FROM Table_1 GROUP BY cardNo,userName,tablename

提交回复
热议问题