开发者

Joining sql views in oracle sql

开发者 https://www.devze.com 2023-01-27 20:56 出处:网络
How can I join views using sql? I\'m using Oracle at the moment? Sql view 1 CREATE VIEW florence_staff AS

How can I join views using sql? I'm using Oracle at the moment?

Sql view 1

CREATE VIEW florence_staff AS
SELECT *
FROM staff
WHERE libnam开发者_如何学Ce ='florence'

Sql view 2

CREATE VIEW alexandria_staff AS
SELECT *
FROM staff
WHERE libname ='alexandria'

I'm doing this to check if the fragmentation is correct, if you get what i mean. Thanks :))


These will be distinct result sets as the libname is different so use UNION ALL rather than UNION

SELECT * FROM florence_staff
UNION ALL
SELECT * FROM alexandria_staff
0

精彩评论

暂无评论...
验证码 换一张
取 消