簡體   English   中英

連接具有相同主鍵的表

[英]Join tables having the same primary key

如何聯接具有相同主鍵的三個表並進行一個視圖? 任何線索將不勝感激。

我有3個表sttm_customersttm_customer_csttm_customer_custom ,它們具有與所有共同的customer_no。

我需要使STVW_CUSTOMER_TEMP合並所有視圖。

如果我了解您要執行的操作,則可以使用UNION:

SELECT customer_no (and any other matching columns)
FROM sttm_customer
UNION 
SELECT customer_no (and any other matching columns)
FROM sttm_customer_c 
UNION customer_no (and any other matching columns)
FROM sttm_customer_custom

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM