如果不是发了那个帖子还不会像这样意外发现这两者的不同,好歹了也工作了一段时间,真是汗颜

 

上例子:

 

执行此条插入语句后,只会插入两条数据,因为会把完全重复的数据过滤掉

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'

 

以上,是今天的心得之一,还要其他的,明天或待会儿再补充

 

 

 

 

相关文章:

  • 2021-10-19
  • 2021-07-01
  • 2021-08-31
  • 2022-03-04
猜你喜欢
  • 2021-11-20
  • 2021-12-22
  • 2021-11-26
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案