Ich möchte Top 3 Verkaufsprodukte für verschiedene Produktkategorie pro Tag herausziehen. Daten sieht wie folgt aus:SQL-select top 3 Werte pro Gruppe MIT BEDINGUNG
tag | product_name | product_category | order_count
tag1 | product1 | category1 | 100
tag1 | product2 | category2 | 80
tag1 | product3 | category2 | 60
tag1 | product4 | category3 | 50
......
Ich weiß, wie oben 3 Verkauf von Produkten ziehen pro Tag mit ROW_NUMBER(), aber es wird wieder product1, product2, product3. Ich möchte nicht Produkt3, weil es zu der gleichen Kategorie wie Produkt2 gehört. Ich möchte stattdessen product4. Wie macht man das in SQL Server?