I want to retrieve data from a single table and then group it by column1, then subgroup it by column2 , then sort it within each one of those groups and finally display upto 10 results from each one of those sorted groups. Can someone please help with pseudocode as I'm having trouble making this work. Right now it looks like
Select * from table_name where some_condition=TRUE group by column1, column2 order by column3. I'm not even sure how to work the limit clause into this statement as this causes only 10 values to be retrieved overall not 10 from every group.