Re: create view error

From: mila boldareva <pg(at)pierro(dot)dds(dot)nl>
To: pgsql-sql(at)postgresql(dot)org
Cc: Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk>
Subject: Re: create view error
Date: 2003-07-07 12:06:29
Message-ID: 1717486813.20030707140629@pierro.dds.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2003-07-07 12:07:54 Re: create view error
Previous Message Gary Stainburn 2003-07-07 11:40:23 create view error