Sql 將A表數據插入到B表


A表和B表字段不同

--insert into B(Name,PersonalId,Education,IsDel)
select Name,
PersonId as PersonalId,
(
case ltrim(rtrim(A.Education)) 
when '中專' then '中學' 
when '大專' then '大學' 
when '本科' then '大學' 
when '本科及以上' then '本科及以上' 
else  '' end
) as Education,
0 IsDel
from A where id in(
select id from A
where Isdel=0
)

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM