Hi,
I have the foll schema.
table1:
*P,A,B,C
table2:
*P,A,B,C
Consider the records in the table:
table1:
P A B C
1 x y n
2 x y n
3 x y n
4 p q y
5 p q n
table2:
P A B C
1 x y y
2 p q y
i need to update the field C in table1 with the filed C in table 2
where table1.A = table2.A and table1.B = table2.B.
the foll query is not working.
update table1 t1
set c=
(select t2.c
from table2 t2
where t1.A = t2.A
and t1.B = t2.B
)
where exists
(select t2.c
from table2 t2
where t1.A = t2.A
and t1.B = t2.B
)
pls help me