From: mila boldareva <pg@pierro.dds.nl>
To: pgsql-sql@postgresql.org
Cc: Gary Stainburn <gary.stainburn@ringways.co.uk>
Subject: Re: create view error
Date: Mon, 7 Jul 2003 14:06:29 +0200
Message-ID: <1717486813.20030707140629@pierro.dds.nl> (raw)
In-Reply-To: <200307071240.23936.gary.stainburn@ringways.co.uk>
References: <200307071240.23936.gary.stainburn@ringways.co.uk>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: pg@pierro.dds.nl, gary.stainburn@ringways.co.uk
Subject: Re: create view error
In-Reply-To: <1717486813.20030707140629@pierro.dds.nl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox