如何在 mysql 中加入 2 个视图?
How to join 2 views in mysql?
我有 2 个包含列的视图,
view1 = (ID, Number)
view2 = (ID, Number, Name)
如何创建 select 显示
Display = (ID, Number, Name)
并且显示是 FULL OUTER JOIN view1 和 view2。
SELECT view2.*
FROM view1
LEFT JOIN view 2
ON view1.id = view2.id
UNION
SELECT view2.*
FROM view1
RIGHT JOIN view 2
ON view1.id = view2.id
我有 2 个包含列的视图,
view1 = (ID, Number)
view2 = (ID, Number, Name)
如何创建 select 显示
Display = (ID, Number, Name)
并且显示是 FULL OUTER JOIN view1 和 view2。
SELECT view2.*
FROM view1
LEFT JOIN view 2
ON view1.id = view2.id
UNION
SELECT view2.*
FROM view1
RIGHT JOIN view 2
ON view1.id = view2.id