In my company, I need to join table A to table B:
- Table A is the sources table
- Table B is the empty table
I want to know that how can I do it and the result like table B?
Source table A:
ID date money HOUR
-----------------------------
1 20-1 10 1
1 20-1 20 2
1 20-1 30 3
1 20-1 40 4
1 21-1 50 1
1 21-1 10 2
1 21-1 20 3
1 21-1 30 4
2 20-1 40 1
2 20-1 50 2
2 20-1 10 3
2 20-1 20 4
Empty table B:
ID date Hour1 Hour2 Hour3 Hour4 Sum
-------------------------------------------------
1 20-1 10 20 30 40 100
1 21-1 50 10 20 30 110
2 20-1 40 50 10 20 120