how to write this update query? [message #602110] |
Fri, 29 November 2013 10:07 |
|
jalal-rasooly
Messages: 11 Registered: November 2013
|
Junior Member |
|
|
assume i have 3 table
**A**************B******************C
-----******-------------*****----------------
pk_a********pk_b***Fk_a******id***fk_b***fk_a
.....*******....***....******..***....***....
*A1**********B1*****A3*******1*****B1
*A2**********B2**************2
*A3**********B3*****A2*******3*****B2
*A4**********B4*****A1*******4*****B1
*****************************5*****B3
fk_a in table B (B.fk_a) and table C (C.fk_a) is foreign key yo table A
fk_b in table C (C.fk_b) is foreign key to table B
now i want for every row in table B that pk_b has a related fk_a (both be in a same row), for any rows in table C that have the same pk_b, put the related fk_a in the same row on column pk_a.
i mean after update table C should look like this:
*********C***********
---------------------
id******pk_b*****pk_a
..******....*****....
*1*******B1*******A3
*2
*3*******B2
*4*******B1*******A3
*5*******B3*******A2
Now I Want TO Know How To Wright This Update Query in oracle?
[Updated on: Fri, 29 November 2013 10:22] Report message to a moderator
|
|
|
|
|
|