A.Z HKHYBT=e.N BZH is matching conditions
as a table SFZH has many null values, I want to achieve when SFZH not null output SFZH, null values, the output by matching the conditions in the table e ZJHM to complement the value of the corresponding SFZH
So how to realize the sigh
CodePudding user response:
As shown in the above, when SFZH is empty, will increase to the corresponding data in a ZJHM SFZH
CodePudding user response:
The select NVL (a.s FZH, e.z JHM) fromgl_cxjylsb_ls a, gl_zhdzb e where a.Z HKHYBT=e.N BZHCodePudding user response:
The select NVL (a.s FZH, e.z JHM) from gl_cxjylsb_ls a, gl_zhdzb e where a.Z HKHYBT=e.N BZHCodePudding user response:
The select NVL (a.s FZH, e.z JHM), a.Z HKHYBT from gl_cxjylsb_ls a left join gl_zhdzb e on a.Z HKHYBT=e.N BZHCodePudding user response:
UPDATE A SET A.S FZH=(SELECT SFZH FROM (SELECT SFZH, NBZH FROM B) T WHERE A.Z HKHYBT=T.N BZH) WHERE A.S FZH IS NULLCodePudding user response:
Using the NVL function matching vacancy, then use the subquery find out the value of the corresponding table b