select * from a
union
select * from b
union
select * from b
解决方案 »
- slq server 通过时间的间隔来查询,求高手答疑
- sqlserver不同机器的两数据库更新数据
- 无法对大小为 8474 的行排序,该值大于允许的最大值 8094
- SqlServer2005 分布式事务处理 和 跨多个数据库服务器数据处理方法
- 服务器改名后SQL7启动不了?为什么呢?
- 从一个表选择记录再加一个变量一起插入另一个表,变量要自加
- 如何判断表中的某个字段必须包含三个值,都包含count就加1。。。求高手帮助!
- 求助在查询管理器或管理工具中的一个问题.
- 初学,向各位请教,在线等待...
- 请问表有容量限制吗?
- 高手们,我遇到拿题了,sql该如何写!
- 小弟100分求广告系统数据库结构解决方案
select * from 表1
union
select * from 表2
union
select * from 表3
select * from 表1
union
select * from 表2
union
select * from 表3
如果[表3]中有重复的数据好像就去不了了吧
insert into 表3 select * from 表2 where code not in (select 主键 from 表3)
加入code是主键:
insert into 表3 select * from 表 where code not in (select code from 表3)
insert into 表3 select * from 表2 where code not in (select code from 表3)