34,587
社区成员
发帖
与我相关
我的任务
分享
create table name1 (id int,name varchar(20),address varchar(50))
insert into name1(select '1','张三','北京')
insert into name1(select '2','李四','深圳')
insert into name1(select '3','王五','武汉')
insert into name1(select '4','李明','上海')
select id,name,address from name1
create table u1(id int)
insert into u1 select 1
insert into u1 select 2
create table u2(id int)
insert into u2 select 1
insert into u2 select 3
go
select * from u1 union select * from u2 order by id desc
select * from u1 union all select * from u2 order by id desc
go
drop table u1
drop table u2
----------------------------
id
-----------
3
2
1
(所影响的行数为 3 行)
id
-----------
3
2
1
1
(所影响的行数为 4 行)