Subject | Update table column from another table |
---|---|
Author | Sonya Blade |
Post date | 2016-01-02T07:24:04Z |
Dear All,
I have difficulty with updating column records of one table from another table columns, which have common columns for relation.
Executed query is as follow :
update elements E set E.END_I = (select n.node_num from nodes N
where (E.X_I =N.XI and E.Y_I = N.YI and E.Z_I=N.ZI) )
where exists (select 1 from nodes N where (E.X_I =N.XI and E.Y_I = N.YI and E.Z_I=N.ZI))
The problem with that is , not all the columns of Elements are updated, only one portion is correctly updated and rest
remains intact. I tried to follow instructions here http://www.firebirdfaq.org/faq323/ but without success. I use old version of
Firebird which is ver 2.1.
What is rong with the code above,
Regards,
I have difficulty with updating column records of one table from another table columns, which have common columns for relation.
Executed query is as follow :
update elements E set E.END_I = (select n.node_num from nodes N
where (E.X_I =N.XI and E.Y_I = N.YI and E.Z_I=N.ZI) )
where exists (select 1 from nodes N where (E.X_I =N.XI and E.Y_I = N.YI and E.Z_I=N.ZI))
The problem with that is , not all the columns of Elements are updated, only one portion is correctly updated and rest
remains intact. I tried to follow instructions here http://www.firebirdfaq.org/faq323/ but without success. I use old version of
Firebird which is ver 2.1.
What is rong with the code above,
Regards,