功能如題,
Informix從一個表更新多選數據到另一個表
例如, 要更新tab01的幾個字段數據, 這些數據來自tab02, tab01和tab02之間通過id關聯
參考語句:
update tab01 set (sex,birthday,addr,tele) = ((select case when sex='男' then 1 else 0 end,age,addr,tele from tab02 where tab02.id=tab01.id)) WHERE exists (select 1 from tab01,tab02 where tab01.id=tab02.id);
注意等號後面的括號