Skip to content
Advertisement

Count number of items per ID

I have a table as below

INPUT

I want to count the items per id, such as

OUTPUT

Using count with group by does not achieve the desire result. What would be the best way to do this?

Advertisement

Answer

Use COUNT():

Result:

For reference, the data script I used is:

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