New: Intelligent Flashcards spaced-repetition decks for every topic, built to make things actually stick.
What does SUM(amount) OVER (PARTITION BY dept) return for each row when no ORDER BY is specified?
SUM(amount) OVER (PARTITION BY dept)
ORDER BY
A single collapsed row per department, like GROUP BY would produce
GROUP BY
A running total that accumulates row by row through the partition
The total amount for the row's department, repeated on every row in that partition