Hi, SQL experts,
I have a requirement as following: my database is oracle 10g.
source data:
id
months
Budget
1
01,02,03
4500
2
01,02,03,04,05
10000
3
01, 02
2000
My target should be :
id, Budget_months
monthly_budget
1
01
1500
1
02
1500
1
03
1500
2
01
2000
2
02
2000
2
03
2000
2
04
2000
2
05
2000
3
01
1000
3
02
1000
basically, the monthly_budget equal to total budget divided by month.
Thank you in advance. |