I have a list of cars
id | brand | model
1 | bmw | 525
1 | bmw | 533
2 | audi | a8
...
I want to take brand occurrences specific to id, for this example:
id | brand | model | n
1 | bmw | 525 | 2
1 | bmw | 533 | 2
2 | audi | a8 | 1
...
Please, i need help with this.
Use
count()
as a window function: