SQLServer Union 和 Union All 在Insert 语句中的不同效果
来源:互联网 发布:windows复制粘贴失效 编辑:程序博客网 时间:2024/06/06 07:35
如果不是发了那个帖子还不会像这样意外发现这两者的不同,好歹了也工作了一段时间,真是汗颜
上例子:
执行此条插入语句后,只会插入两条数据,因为会把完全重复的数据过滤掉
insert into test
select 1,'a' union
select 2,'b' union
select 1,'a'
如果有完全相同的数据要插入,则用union all
insert into test
select 1,'a' union all
select 2,'b' union all
select 1,'a'
以上,是今天的心得之一,还要其他的,明天或待会儿再补充
0 0
- SQLServer Union 和 Union All 在Insert 语句中的不同效果
- sql语句中的union和union all
- union和union all有什么不同
- union和union all有什么不同?
- union和union all有什么不同?
- SQL语句 UNION 和 UNION ALL 使用
- SQL语句之Union和Union All
- SQL语句UNION和 UNION ALL
- select 中的union 和union all用法
- select 中的union 和union all用法
- oracle中的union和union all
- sql中的union 和union all
- SQL中的UNION和UNION ALL
- oracle中的union和union all-yellowcong
- union all 和union
- union 和 union all
- UNION 和 UNION ALL
- union和union all
- Mysql-----case when then else end
- android开发之线程的问题
- 时间复杂度和空间复杂度详解
- SQLServer 行转列,统计,二次分组
- 乐视&TCL战略成果发布会,这数据吓到友商了!
- SQLServer Union 和 Union All 在Insert 语句中的不同效果
- View在屏幕中的位置
- iPhone SE销量惨淡?看看这些数据就知道了
- SQLServer inner join,left join,right join,outer join 备忘备忘
- Ubuntu搭建subversion+usvn环境
- SQLServer 表连接时使用top 1 去除重复数据
- 如何更改linux文件的拥有者及用户组(chown和chgrp)
- SQLServer 使用变量动态行转列
- 第5周项目1(5) 三角形类锥形