79112636

Date: 2024-10-22 06:14:22
Score: 1
Natty:
Report link

As commented by @Paul Maxwell, for your requirement, you can include a row number calculation such as given below,

row_number() over(partition by date, product, country order by total_sales) as rn then filter for where rn <= 10 .

Posting the answer as community wiki for the benefit of the community that might encounter this use case in the future. Feel free to edit this answer for additional information.

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @Paul
  • Low reputation (0.5):
Posted by: Dhiraj Singh