MS-Access: Merge two tables "below" each other
ms-access, ms-access-2007, sql
Solution
SELECT *
FROM Table1
UNION
SELECT *
FROM table2;
Problem
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 | +--------------+----------+----------+----------+ ``` 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 | +--------------+----------+----------+----------+ ``` The names "Column1", "Column2" and "Column3" are the same in both tables