update select 多字段


update Countrys set (
    Abbreviation_cn,
    Abbreviation_en,
    Two_code,Three_code,
    Number_code)= 
    (select  [cn_name],
            [en_name],
            [two_code],
            [free_code],
            convert(int,number_code) as [number_code]
     from  Country.dbo.worlds a where a.cn_name=Countrys.Abbreviation_cn)

 

    
UPDATE Countrys   SET  Abbreviation_cn= Country.dbo.worlds.cn_name,
                Abbreviation_en=Country.dbo.worlds.en_name,
                Two_code=Country.dbo.worlds.two_code,Three_code=Country.dbo.worlds.free_code
                   FROM Countrys,Country.dbo.worlds WHERE Countrys.chinese_name+' '+Countrys.english_name = Country.dbo.worlds.all_name

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM