Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create view country_stat as select one.name, one.pilots, two.autodroms from (select a.name, listagg(b.shortname, ',') within group (order by b.LastName) Pilots
- from countries a left join pilots b on b.idcountry=a.id
- group by a.name) one
- left join (select a.name, listagg(b.name, ',') within group (order by b.name) Autodroms
- from countries a left join tracks b on b.idcountry=a.id
- group by a.name) two on two.name=one.name;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement