Hi,
I have a table, that has a simple structure:
user_id, month, balance, balance_type
I want to display selected balance types per month for each user that is:
user_id, month, balance_1, balance_2, balance_3, balance_...
So from data:
ROW user_id month balance balance_type
1 5667 09 20 2068
2 5667 08 23 2068
3 5667 07 21 2068
4 5667 06 19 2068
5 5667 10 22 2068
6 5667 09 20 2069
7 5667 08 23 2069
8 5667 06 19 2069
9 5667 07 21 2069
10 5667 10 22 2069
11 5667 09 4199 2114
12 5667 06 4329 2114
13 5667 08 4365 2114
14 5667 10 4172,88 2114
15 5667 07 4000 2114
16 5667 10 572,1 6062
17 5667 08 598,44 6062
18 5667 07 548,4 6062
19 5667 06 593,51 6062
20 5667 09 575,69 6062
I would get for example for month 09:
user_id, month, balance_1, balance_2, balance_3, balance_4
5667 09 20 20 4199 575,69
What is the best solution for this in SQL or/and PL/SQL?