注册 登录
编程论坛 SQL Server论坛

[求助]数据库基础方面的问题-->bygg转移

liuminghui 发布于 2007-02-10 12:46, 708 次点击
请问:
union union all是什么意思啊?
他们有什么区别啊??
在线等待........
1 回复
#2
棉花糖ONE2007-02-10 13:04

if object_id('shiyan') is not null
drop table shiyan
go
create table shiyan(col char(2))
insert into shiyan select 'a'
union select 'a'
select * from shiyan


if object_id('shiyan') is not null
drop table shiyan
go
insert into shiyan select 'a'
union all select 'a'
select * from shiyan
你把这两个放到查询分析器执行一下就知道区别了

1