This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / TSQL knowledge test. for fun only.
-whatwhenwherewhy(一生何求);
2004-11-22
{538}
(#1993188@0)
-
create table dropit (col1 varchar(9),col2 varchar(9))
select * from dropit
drop table dropit
create table aa (col1 varchar(9),col3 varchar(9))
insert into dropit values ('1','1') -- the table does not exist
-bluebison(不是很牛);
2004-11-22
(#1993678@0)
-
sorry, comment out "drop table dropit". this actually is testing you update one row with 2 return value. in Oracle the same logic will give you error immediately, but tsql not, the result is unpredictable.create table dropit (col1 varchar(9),col2 varchar(9))
--select * from dropit
--drop table dropit
create table aa (col1 varchar(9),col3 varchar(9))
insert into dropit values ('1','1')
insert aa values ('1','a')
insert aa values ('1','aa')
--select * from aa
update dropit set col2=a.col3 from dropit d,aa a where d.col1=a.col1
select col2 from dropit
-whatwhenwherewhy(一生何求);
2004-11-23
{372}
(#1994107@0)