MS-Access:合并两个表“下面"彼此 [英] MS-Access: Merge two tables "below" each other

查看:56
本文介绍了MS-Access:合并两个表“下面"彼此的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Access数据库中有两个表.他们看起来像这样:

I have two tables in my Access-database. They look something like this:

Table1
+--------------+----------+----------+----------+
| Kabelnummer  |  Column1 |  Column2 |  Column3 |         
+--------------+----------+----------+----------+
| 1            |    x     |    x     |    x     |
+--------------+----------+----------+----------+
| 2            |    x     |    x     |    x     |
+--------------+----------+----------+----------+
| 3            |    x     |    x     |    x     |
+--------------+----------+----------+----------+
| 4            |    x     |    x     |    x     |
+--------------+----------+----------+----------+

table2
+--------------+----------+----------+----------+
| Kabelnummer  |  Column1 |  Column2 |  Column3 |        
+--------------+----------+----------+----------+
| 1            |    x     |    x     |    x     |
+--------------+----------+----------+----------+
| 2            |    x     |    x     |    x     |
+--------------+----------+----------+----------+
| 3            |    x     |    x     |    x     |
+--------------+----------+----------+----------+
| 4            |    x     |    x     |    x     |
+--------------+----------+----------+----------+

我需要一个查询,该查询为我提供一张表,其中将table1中的数据添加到table2中的数据:

I need a query that gives me 1 table with the data from table1 added to the data from table2:

TableTotal
+--------------+----------+----------+----------+
| Kabelnummer  |  Column1 |  Column2 |  Column3 | 
+--------------+----------+----------+----------+
| 1            |    x     |    x     |    x     |
+--------------+----------+----------+----------+
| 2            |    x     |    x     |    x     |
+--------------+----------+----------+----------+
| 3            |    x     |    x     |    x     |
+--------------+----------+----------+----------+
| 4            |    x     |    x     |    x     |
+--------------+----------+----------+----------+
| 1            |    x     |    x     |    x     |
+--------------+----------+----------+----------+
| 2            |    x     |    x     |    x     |
+--------------+----------+----------+----------+
| 3            |    x     |    x     |    x     |
+--------------+----------+----------+----------+
| 4            |    x     |    x     |    x     |
+--------------+----------+----------+----------+

两个表中的名称"Column1","Column2"和"Column3"相同

The names "Column1", "Column2" and "Column3" are the same in both tables

推荐答案

SELECT *
FROM  Table1

UNION

SELECT *
FROM table2;

这篇关于MS-Access:合并两个表“下面"彼此的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆