I have a table that looks like this:
posid sales eid
1 20 001
1 20 002
1 30 001
2 30 001
1 30 002
2 30 001
1 30 002
2 20 002
2 10 002
I want to write a query that would give me sum of sales for each employee on particular pos. the result needs to be like this.
pos id emp id sales
1 001 50
1 002 80
2 001 60
2 002 30
How would I do this?