Received: from echna.ne.jp (echna.ne.jp [210.175.52.4]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fB5FGHm81161 for ; Wed, 5 Dec 2001 10:16:18 -0500 (EST) (envelope-from rk73@echna.ne.jp) Received: from VIP333 [210.175.55.191] by echna.ne.jp with ESMTP (SMTPD32-6.06) id AA43F1FF0210; Thu, 06 Dec 2001 00:16:19 +0900 Date: Thu, 06 Dec 2001 00:16:43 +0900 From: Masaru Sugawara To: Manuel Trujillo Subject: Re: problems with this wiew Cc: pgsql-sql@postgresql.org In-Reply-To: <20011204223121.17449.qmail@213-145-170-138.dd.nextgentel.com> References: <20011204100538.O4858-100000@megazone23.bigpanda.com> <20011204223121.17449.qmail@213-145-170-138.dd.nextgentel.com> Errors-To: Message-Id: <20011206001443.FBCC.RK73@echna.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.00.06 X-Archive-Number: 200112/47 X-Sequence-Number: 5870 On Tue, 04 Dec 2001 22:31:21 GMT "Aasmund Midttun Godal" wrote: > Well if you have spelled view "wiew" - that may be part of your problem, > > sincerely, > > Aasmund. > On Tue, 4 Dec 2001 10:07:17 -0800 (PST), Stephan Szabo wrote: > > On Tue, 4 Dec 2001, Manuel Trujillo wrote: > > > > > > I'm probably missing something obvious, but > > in any case the schema for tables and views > > involved (preferably in create statements), > > your PostgresQL version and the actual error > > message you're getting would help us. > > > Aasmund Midttun Godal > > aasmund@godal.com - http://www.godal.com/ > +47 40 45 20 46 > I would think his problem is caused by how to use aliases, at least, D is apparently unnecessary. Since I don't know the definitions of his tables, I can't affirm what type of an error happened. But if his tables are correctly defined, his error is probably: ERROR: Column reference "***" is ambiguous. If so, the vague columns reference of his query ought to be adjusted with explicitly using aliases: B, C, and E (e.g. see below). select E.gallery_id, E.multimedia_id from view_multimedia_file A inner join (select B.gallery_id, B.multimedia_id, B.element_type_id, C.result_type_id, C.subevent_id, C.subevent_type_id, C.event_id, C.championship_id, C.championship_type_id, C.season_id, C.c_language_id as language_id from view_gallery B inner join (select gallery_id as c_gallery_id, result_type_id, subevent_id, subevent_type_id, event_id, championship_id, championship_type_id, season_id, language_id as c_language_id from view_gallery_result_type ) C on (B.gallery_id = C.c_gallery_id) ) E on (A.mm_id = E.multimedia_id) ; Regards, Masaru Sugawara