当前位置:Gxlcms > 数据库问题 > SQL把a表字段数据存到b表字段 update,,insert

SQL把a表字段数据存到b表字段 update,,insert

时间:2021-07-01 10:21:17 帮助过:23人阅读

update SYS_Navigation set
SYS_Navigation.PARENT_XH = SYS_Power_menu.parent_id,
SYS_Navigation.web_title = SYS_Power_menu.menu_name,
SYS_Navigation.WEB_FLAG=1,
SYS_Navigation.url=SYS_Power_menu.url
from SYS_Power_menu
where SYS_Navigation.xh = SYS_Power_menu.menu_id;

 

 

------------------------------------------------------

格式、

------------------------------------------------------

--insert into B (id,columnB) select id,columnA from A where id not in (select id from B)

-------------------------------------------------------
INSERT INTO SYS_Power (
UserOrGroupID,
UGTYPE,
POWERtype,
source,
navigationXH
) SELECT
1,
0,
4,
1,
SYS_Navigation.xh
FROM
SYS_Navigation
WHERE
SYS_Navigation.xh in (select navigationXH from SYS_Power ) AND SYS_Navigation.WEB_FLAG=1 ;

SQL把a表字段数据存到b表字段 update,,insert

标签:user   from   menu   lag   source   ror   格式   col   ati   

人气教程排行