Iamlasong
Requirements: The contents of the table need to be changed, the content of the change is placed in a temporary table, and the SQL statement is used to update multiple fields in the formal table.
If you update a field directly with the field name = subquery, multiple fields are updated, and the fields are written in parentheses, as follows:
Update TB_JG T
Set t.jgfl = ' SD ',
(T.zj_code, T.ZJ_MC) = (select A.zj_code, A.ZJ_MC
From Song_temp A
where A.zj_code = T.zj_code)
where exists (select 1 from song_temp a where a.zj_code = T.zj_code)
Requirements: Create a table from a subquery, with the following statement:
CREATE TABLE SNCN_ZD_JG as SELECT * from TB_JG where zdbz= ' 1 ' ORDER by City_code,xs_code;
If the table already exists, the following statement can insert the query result:
INSERT INTO SNCN_ZD_JG select * from TB_JG where zdbz= ' 1 ' ORDER by City_code,xs_code;