create table A
(
Id int identity(1,1) not null,
Bid int not null,
Name varchar(20) null
)
create table B
(
Id int identity(1,1) not null,
Name varchar(20) null
)
1.
update A set Name=B.Name from B where A.Bid=B.Id
2.
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 SERVERP 批量 UPDATE 示例
最新推荐文章于 2024-07-31 11:03:47 发布