Skip to content
Advertisement

SQL group by (count,sum)

Hello i need help abou SQL a have this table

My table

and i need this result.

Result waned

thanks for your attention and your answers.

Advertisement

Answer

You can use a sum and group by as below:

Please also bear in mind that date is a reserved word for a datatype in many RDBMS systems, as such I would suggest naming your columns as something more appropriate, avoiding reserved words.

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