SQL - Advanced Window Functions
Given the table
Assume the data:
sales_data with columns product and amount, what is the output of this query?SELECT product, amount, ROUND((amount / SUM(amount) OVER ()) * 100, 1) AS percent_total FROM sales_data ORDER BY product;
Assume the data:
product | amount
-------|-------
A | 50
B | 30
C | 20