Sql 具有相同主键的联接表
如何连接具有相同主键的三个表并生成一个视图?任何线索将不胜感激 我有三个表Sql 具有相同主键的联接表,sql,join,view,Sql,Join,View,如何连接具有相同主键的三个表并生成一个视图?任何线索将不胜感激 我有三个表sttm\u customer,sttm\u customer\u c和sttm\u customer\u custom, 所有人都没有共同点 我需要创建一个视图,将所有视图合并起来。如果我了解您的意图,您可以使用UNION: SELECT customer_no (and any other matching columns) FROM sttm_customer UNION SELECT customer_no (a
sttm\u customer
,sttm\u customer\u c
和sttm\u customer\u custom
,
所有人都没有共同点
我需要创建一个视图,将所有视图合并起来。如果我了解您的意图,您可以使用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
另外,这三个表还有更多的共同点。为什么有3个几乎相似的表?看起来db设计很差。