亲自试了一下,确实可以: create table temp1 ( userName varchar(20), counts int ) insert into temp1 values('AA',10); insert into temp1 values('BB',71); insert into temp1 values('CC',15); insert into temp1 values('DD',66); 执行下面的sql,通过,没问题 update (select userName,Counts from temp1) set counts =50 where 1 =1;
Select A.a1 a1,B.b1 b1 from A,B where A.a1=B.b1 只是得到一个记录集,跟临时表没什么关系
update A set a1=1;
commit ;
(Select A.a1 a1,B.b1 b1 from A,B where A.a1=B.b1)
set a1 = 1
where 1=1;
提交后,这样对数据库中的数据有影响吗??
syntax:
Update <tablename>
set <columnname1> = <expression1>[<columnname2> = <expression2>,...]
[where <condition>];
create table temp1
(
userName varchar(20),
counts int
)
insert into temp1 values('AA',10);
insert into temp1 values('BB',71);
insert into temp1 values('CC',15);
insert into temp1 values('DD',66);
执行下面的sql,通过,没问题
update (select userName,Counts from temp1) set counts =50 where 1 =1;
只是得到一个记录集,跟临时表没什么关系