Skip to content
Advertisement

SQL count rows with same value in column and group by id?

i have a table like this:

i wonder if its possible to count the rows with same value and group them by id , but every time the code will return count 1 if i group them by id and not by value

wanted output:

Advertisement

Answer

You need to count the value of the column value for each id:

See the demo
or:

See the demo

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