![](/img/trans.png)
[英]How to put records from two different tables into one column through SELECT statement?
[英]Select a column from two tables and put them into one
我不僅僅意味着將它們放在一起,因為我在表1中有一行寫着“東西”,而在表2中又有一行寫着“東西”,並將它們放到一個單獨的單元格中,上面寫着“東西”,我只是意味着將表1和表2中的所有數據簡單地合並為一列。 例如....
Table 1:
Item 1
Item 2
Item 3
Table 2:
Item 4
Item 5
Item 6
New Table:
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
我所有的嘗試都是這樣的
Select (Table1.Row + Table2.Row) AS JobNumber
FROM Table1, Table2;
它只是像
Item 1Item 2
Item 1Item 3
.....
etc.
我認為您想要一個UNION查詢:
SELECT Table1.Row AS JobNumber
FROM Table1
UNION
SELECT Table2.Row AS JobNumber
FROM Table2
或UNION ALL(如果要復制)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.