I am not able to phrase the mqsql query for the shown table and values. I want the output as shown. The below values are in tabular form .
**Name | Time**
RWS | 1
CMS | 2
JT | 2
CMS | 1
RWS | 2
JT | 1
RWS | 1
I want the output as
**Name | time**
RWS | 4
CMS | 3
JT | 3
You want to use SUM()
aggregate function along with a GROUP BY
clause like
select `Name`, sum(`Time`) as `Time`
from table1
group by `Name`
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments