English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

eg. table1 and table2 both have columns called contactid;
What is the UPDATE command to convert all the values from table1.contactid to table2.contactid in PLSQL?

2007-01-27 09:27:55 · 2 answers · asked by shanhelp 3 in Computers & Internet Programming & Design

2 answers

Update table2.contactid set table2.contactid = (select table1.contactid from table1);

committ;

If you have another condition to concatinate the two tables, then you can write the condition in the select statement.

2007-01-27 09:33:23 · answer #1 · answered by Lotus 2 · 0 0

What is the primary key? Supposing it is keyval, then:

update table1 t1
set t1.contactid = (select contactid from table2 t2
where t1.keyval=t2.keyval)

2007-01-27 09:38:11 · answer #2 · answered by BigRez 6 · 0 0

fedest.com, questions and answers