insert into dbo.tab(RR_ID, RR_SELECT_ID)
SELECT RR_ID, RR_SELECT_ID,
FROM dbo.tabETEMP
where not exists (select distinct RR_ID from dbo.tab
where dbo.tab.RR_ID=dbo.tabETEMP .RR_ID)
update dbo.tab set Detail_IsCalled=FEETEMP.IsSpotChecked
from (select ID, IsSpotChecked from tabETEMP ) as FEETEMP
where dbo.tab.ID=FEETEMP.ID
博客给出了两条SQL语句,一条是插入操作,将dbo.tabETEMP表中在dbo.tab表不存在的RR_ID和RR_SELECT_ID插入到dbo.tab表;另一条是更新操作,根据tabETEMP表的IsSpotChecked值更新dbo.tab表的Detail_IsCalled字段。
3100

被折叠的 条评论
为什么被折叠?



