Hi, Gary!

> CREATE
> create view loco_dets as
>   select * from locos l
>       left outer join 
>         (select * from lclass) lc on lc.lcid = l.lclass
>       left outer join
(*)          (select lnumber from lnumbers) ln on ln.lnid = l.lid and ln.lncurrent
> = true
>       left outer join
>         (select * from company) c on c.coid = lc.lcompany;
> ERROR:  No such attribute or function ln.lnid


your subselect on line (*) does not contain lnid in the list of
selected fields.

I suspect you can also use constructions like

 select * from locos l left outer join lclass lc on (lc.lcid = l.lclass)

 instead of what you use:
> select * from locos l
>       left outer join 
>         (select * from lclass) lc on lc.lcid = l.lclass 

in this way you automatically avoid the error that you had!

cheers,
Mila


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to