简单地说,我有2个彼此具有“等效”行的表。等效性在第3映射表(将ID A映射到ID B)中维护。在视图中,我想创建一个显示:
的统一视图以图形方式解释更容易......
我有以下情况(如下图所示):
我确信这比看起来要简单得多 - 我已经咀嚼了一会儿而无法让它变得可行。
答案 0 :(得分:0)
如何
select a.ID as A_ID, a.Desc as A_Desc, b.ID as B_ID, b.Desc as B_DESC
from Table_A as a left outer join Mapping_Table as m on a.ID = m.A_ID
full outer join Table_B as b on m.B_ID = b.ID