--我测试过是可以的.create view test as select * from sysobjects union select * from sysobjects gocreate view test1 as select * from sysobjects union all select * from sysobjects godrop view test,test1
--查询分析器中执行下面的语句创建视图:create view 视图名 as select * from student union all select * from teacher
union 的话,会去掉结果集中的重复记录,而union all 则不会.
我建出来了 create view passwordview as select s_num,s_password from student union all select t_num,t_password from teacher 我这样建的话,我以后引用这个视图的列名时该用什么呢?
不知道union和union all有什么不一样呢?
as
select * from sysobjects
union
select * from sysobjects
gocreate view test1
as
select * from sysobjects
union all
select * from sysobjects
godrop view test,test1
as
select * from student
union all
select * from teacher
create view passwordview
as
select s_num,s_password from student
union all
select t_num,t_password from teacher
我这样建的话,我以后引用这个视图的列名时该用什么呢?