Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 sql 加入视图?我现在正在使用 Oracle 吗?
sql视图1
CREATE VIEW florence_staff AS SELECT * FROM staff WHERE libname ='florence'
sql视图2
CREATE VIEW alexandria_staff AS SELECT * FROM staff WHERE libname ='alexandria'
我这样做是为了检查碎片是否正确,如果你明白我的意思。谢谢 :))
这些将是不同的结果集,因为它们libname是不同的,所以使用UNION ALL而不是UNION
libname
UNION ALL
UNION
SELECT * FROM florence_staff UNION ALL SELECT * FROM alexandria_staff