首页 > 数据库技术 > 详细

sql多表更新使用别名(小技巧)

时间:2018-07-09 14:01:33      阅读:195      评论:0      收藏:0      [点我收藏+]
update
    A
set
    A.CityRegionID=B.ParentID,
    A.CityName=(select RegionName from Common_Region where RegionID=B.ParentID)
from
    User_Common_Address A,Common_Region B
where
    A.CityRegionID=B.RegionID

sql多表更新使用别名(小技巧)

原文:https://www.cnblogs.com/cuihongyu3503319/p/9283402.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!