I have a Sales table, with the following columns:
- employeeID
- amount
- date
Now I want to SUM
up the last 15 rows, so I am currently doing:
SELECT TOP 15 SUM(amount) FROM Sales ORDER BY [Date] DESC
But I get 15 rows obviously, is there a way I can sum it up and not have to loop through and SUM it on the client side?