access合并数据库中两个完全一样两表中的数据
方法如下:
1、打开数据库;
2、点击查询——右键点击“在设计视图中创建查询”——打开查询设计视图——点击关闭——选择视图菜单——SQL视图——打开SQL视图编辑器;
3、输入以下代码:
select * into 新表名称
from(select * from 数据表名称一;
union all
from(select * from 数据表名称二;
union all
from(select * from 数据表名称三;
union all
select * from 数据表名称N);
示例如下:
SELECT * INTO zonghe
FROM (select * from fushi
union all
select * from ganhuo
union all
select * from hufu
union all
select * from wenti
union all
select * from jiaju
union all
select * from wanju
union all
select * from muying
union all
select * from shuma
union all
select * from jingshuiji
union all
select * from kongqijinghua
union all
select * from kouzhao
union all
select * from pphuoxingtan
union all
select * from huoxingtan
union all
select * from hetao
union all
select * from dazao
union all
select * from xianggu
union all
select * from muer
union all
select * from quan);
4、保存,命名合并,点击运行,OK!
以后,需要的话用此命令的话,直接点击设计查询,双击此合并数据表就OK!