I have the following table in redshift:
ID, Category
flinch, cat
flinch, cat
mara, dog
mara, cat
the aim here is to get for each ID the number of occurences of each category , hence the expected resut would be:
ID,Category,size
flinch, cat, 2
mara, dog, 1
mara, cat, 1
I tried several queries but got exceptions :ERROR: could not identify an ordering operator for type record Hint: Use an explicit ordering operator or modify the query.