how to update following data ???
i have 2 tables table A nd table B
i need to update content from table A to table B having following data
Table A Structure & Data (Table B structure is also same as B)
-----------------------------------
SQL> DESC A
EMPID NUMBER(3)
MONTH VARCHAR2(6)
GRADE VARCHAR2(1)
AMOUNT NUMBER
EMPID MONTH GRADE AMOUNT
-----------------------------------------------------------------
111 012007 A 100
111 042007 B 200
111 072007 C 300
222 062007 A 200
222 082007 B 400
222 112007 C 600
Table B contains complete data as (example for empid 111)
EMPID MONTH GRADE AMOUNT
-----------------------------------------------------------------
111 012007 x 50
111 022007 x 50
111 032007 x 50
111 042007 y 60
111 052007 x 50
111 062007 x 50
111 072007 x 50
111 082007 y 60
111 092007 z 65
222 062007 x 50
222 072007 x 50
222 082007 x 50
222 092007 y 60
222 102007 x 50
222 112007 x 50
222 122007 x 50
222 012008 y 60
output
----------
EMPID MONTH GRADE AMOUNT
-----------------------------------------------------------------
111 012007 A 100
111 022007 A 100
111 032007 A 100
111 042007 B 200
111 052007 B 200
111 062007 B 200
111 072007 C 300
111 082007 C 300
111 092007 C 300
222 062007 A 200
222 072007 A 200
222 082007 B 400
222 092007 B 400
222 102007 B 400
222 112007 C 600
222 122007 C 600
222 012008 C 600
so now i need to update Table B with Table A data
for example in Table A foe emp id has 3 records
so for 1st month in Table A (i.e 012007) i need to update grade and amount in table B w.r.t table A
this update should be done for all records until 2nd record in table A (i.e 012007,022007,032007)
i.e for months from 012007 to 032007 in table B the grade and amount to be update
2nd record in table A(empid 111) is 042007
so in table B from months 042007 to 062007 2nd record data to be updated
Regards,
Santosh Minupurey