Top Grossing Products by Category
Given a
product_spend table documenting customer transactions, write a query to retrieve the top two highest-grossing products within each category for the calendar year 2022. Gross spend is defined as the sum of the spend column for a given product. Your output should include the category name, the product name, and the total calculated spend, ordered by category and then by the highest spend.SnowflakeWindow FunctionQUALIFY ClauseCTEAggregate Function
00