如何连接具有相同主键的三个表并创建一个视图?任何线索将不胜感激。
我有3个表sttm_customer
,sttm_customer_c
和sttm_customer_custom
,
customer_no与所有人共同拥有。
我需要制作一个视图STVW_CUSTOMER_TEMP
合并所有视图。
答案 0 :(得分:0)
如果我理解你要做什么,你可以使用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