Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

UPDATE - problem (from table1 to table 2)

872623Jul 25 2011 — edited Jul 26 2011
Hello all,

i have those two tables:
ID	TIP	CON	PRO
100000	1	2824,8	2824,8
200000	1	336,59	336,59
300000	1	26587,44	19909,59
400000	1	4800	4800
AND second table (table where we need to update 1 collum)
Year	round	ID	Bill	con	pro
2011	7	100000	1855	598,98	0
2011	7	100000	1856	1144,8	0
2011	7	100000	1857	927,72	0
2011	7	100000	1858	153	0
Ok tables are set. What i need to do is take Value PRO from table 1 for example under ID 100000 and update table 2 under same ID.
But each time i update row by row (under same ID) i should deduct one value from BILL collum. For example like this:
2824,8  <- starting with this number
2225,82 <- after updating BILL 1855
1081,02 <- after updating BILL 1856
.
.
.
and so on till i reach 0 (i shouldnt reach negative number ... so ZERO is last number that can be UPDATED)
Ok i hope i made it clear ... my English is bad and its really hard for me to explain what the problem is.
If anyone care to help you are very welcome to do so ... and ask away if you need more detailed explanation!

Thank you!

Edited by: Cain_oracle on 25.7.2011 3:54
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 23 2011
Added on Jul 25 2011
5 comments
125 views