Skip to content
Advertisement

SQL count by type

I would like to summarize in a table so that I have for each id in each round, the number of tokens “red” and “blue”. What would the SQL query for such table?

Here’s the data.

The result will display like below:

I have been trying the following code:

Advertisement

Answer

I would suggest this to get to the requested result table:

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