Вам нужно использовать union
, как в обычном select
запросе:
create or replace view auction_view3 as
select row_number() over(order by f.userid) as id, f.userid, r."type", a.street, a.homenumber, a.localnumber, a.city, a.postcode, f.price, f."size", f.rooms, f.floor
from address a, flat f, realassets r
where f.addressid = a.id and a.realassetid =r.id
union all
select row_number() over(order by p.userid) as id, p.userid, r."type", a.street, a.homenumber, a.localnumber, a.city, a.postcode, p.price, p."size", p.rooms, p.floor
from address a, plot p, realassets r
where p.addressid = a.id and a.realassetid =r.id
union all
select row_number() over(order by h.userid) as id, h.userid, r."type", a.street, a.homenumber, a.localnumber, a.city, a.postcode, h.price, h."size", h.rooms, h.floor
from address a, house h, realassets r
where h.addressid = a.id and a.realassetid =r.id
Здесь union all
работает быстро, но не удаляет дубликаты, если вы не хотите, их - используйте union
вместо.