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