Skip to content
Advertisement

how to fetch top 9 and others based on count(entity_id) sorted highest top 9 and then club the other count into ‘others’ category

The following query executes everything:

I tried the following:

Any help would be appreciated…

Advertisement

Answer

Use row_number() and two levels of aggregation:

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