Skip to content
Advertisement

SUM of columns duplicates

I have table as below

I want to get below results,

Advertisement

Answer

You can use date format method of sql to get the desired result

SELECT DATE_FORMAT(date, ‘%Y-%m-%d’) as date_column, JOB_ID, Name, sum(“count”) FROM tab GROUP BY date_column, JOB_ID, Name;

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement