Aggregate Functions on subsets of data based on current row values with SQL
- by aasukisuki
Hopefully that title makes sense...
Let's say I have an employee table:
ID | Name | Title | Salary
----------------------------
1 | Bob | Manager | 15285
2 | Joe | Worker | 10250
3 | Al | Worker | 11050
4 | Paul | Manager | 16025
5 | John | Worker | 10450
What I'd like to do is write a query that will give me the above table,…