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