22,209
社区成员
发帖
与我相关
我的任务
分享
--测试数据
if not object_id(N'opcode') is null
drop table opcode
Go
Create table opcode([code] int,[otype] int)
Insert opcode
select 1,1 union all
select 2,1 union all
select 3,1
GO
if not object_id(N'opcodebak') is null
drop table opcodebak
Go
Create table opcodebak([code] int,[otype] int)
Insert opcodebak
select 1,2 union all
select 2,3 union all
select 3,4
Go
--测试数据结束
update opcode set otype=a.otype from opcodebak as a where a.code=opcode.code;
SELECT * FROM opcode
update opcode set otype=a.otype from opcodebak as a where a.code=opcode.code;
这句看着没问题,楼主说不对是怎么了?