Skip to content
Advertisement

Select first 10 rows of a column in a table

Can you please let me know how to select first 10 rows for every cusip in the below table

Advertisement

Answer

Use ROW_NUMBER() with a partition over your groups and order by whatever you need, then filter for the first 10 rows:

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