1个回答
展开全部
create table x
(
a int,
b varchar(20)
)
insert into x (a ,b ) values (1,'a');
insert into x (a ,b ) values (2,'b');
insert into x (a ,b ) values (3,'c');
insert into x (a ,b ) values (4,'d');
create table y
(
b int,
c varchar(20)
)
insert into y (c ) values ('a');
insert into y (c ) values ('e');
insert into y (c ) values ('c');
insert into y (c ) values ('f');
select * from x
select * from y
update y set [b] = m.a from
(select x.*,y.c from x inner join y on x.b =y.c ) m
where y.c =m.c
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询