这样也能就是不行的你可以创建视图
create view test as
select id1 from mytable
union
select id2 from mytable
union
select id3 from mytable
go
insert into .....select * from test
go
create view test as
select id1 from mytable
union
select id2 from mytable
union
select id3 from mytable
go
insert into .....select * from test
go
解决方案 »
- .lib文件是什么数据库,用什么打开
- SQL 2005的触发器,在哪儿创建呀,界面上找不到呀??
- 不能以 DISTINCT 方式选择 text、ntext 或 image 数据类型
- SQL语句怎样写能实现先按 Sorting排列,再按 news排列,最后按 nameid排列
- 事务
- SQL语句请教-关于删除表
- SQL 连接登录问题
- 这样的sql语句怎么写?
- 请教各位高手;怎样在每天晚上12点自动更新数据库中表的列值(MS SQLSER)。
- 哪位能说出这些小型数据库的区别吗?
- 请问sql查询语句中用哪个函数来格式化输出数据?
- 怎样通过Sql语句选择出我自己创建的角色名,而不包括sql server自己生成的那一堆角色?
go
insert #temp select id2 from mytable
go
insert #temp select id3 from mytable
go
insert sa select * from #temp
go
select * from
(
select id1 from mytable
union
select id2 from mytable
union
select id3 from mytable
)
AAA
I made a mistake just now.in fact the sql statements:
insert into sa
select id1 from mytable
union all
select id2 from mytable
union all
select id3 from mytable
能够使用union,只是我开始的时候忘了加all,导致相同的结果只出现一次。
谢谢四位大哥。