can someone answer this please
First group by category then order by price.
you can use rank()
thanks I'm working with the database on Colab (pandas.read_sql_query), rank() syntax gives error I don't know why. I've write this query and it works fine but how can I get 10 rows for each unique category_id? SELECT product_id, category_id, price FROM products WHERE ( SELECT COUNT(*) FROM products ORDER BY category_id ASC, price DESC )
Обсуждают сегодня