Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7F14047659B for ; Thu, 23 Jan 2003 00:03:08 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 027A44753A1 for ; Thu, 23 Jan 2003 00:00:45 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id C481D43A439; Thu, 23 Jan 2003 00:00:44 -0500 (EST) From: "Igor" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: CREATE VIEW ERROR Date: Thu, 23 Jan 2003 16:00:45 +1100 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 56 Message-ID: References: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 To: pgsql-sql@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/366 X-Sequence-Number: 11231 I found answer. Thank you for everyone who did not reply. CREATE VIEW depend_view AS SELECT depend.subfunction_id, a.subfunction_file AS x, depend.subfunction_dep_id, b.subfunction_file AS y FROM depend INNER JOIN subfunction a ON depend.subfunction_id = a.subfunction_id INNER JOIN subfunction b ON depend.subfunction_dep_id = b.subfunction_id; "Igor" wrote in message news:d418ccf3.0301181703.57244c80@posting.google.com... > Hi, > > I have following SQL statement which does not report any errors: > > test=# SELECT a.subfunction_file, b.subfunction_file > test-# FROM depend INNER JOIN subfunction a ON depend.subfunction_id = > a.subfunction_id > test-# INNER JOIN subfunction b ON depend.subfunction_dep_id = > b.subfunction_id; > subfunction_file | subfunction_file > ----------------------------+---------------------------- > show_batch_2.php | search_receipt.php > ........... > > But when I try to create VIEW a have following error: > > test=# create view depend_view as SELECT a.subfunction_file, > b.subfunction_file > test-# FROM depend INNER JOIN subfunction a ON depend.subfunction_id = > a.subfunction_id > test-# INNER JOIN subfunction b ON depend.subfunction_dep_id = > b.subfunction_id; > > ERROR: CREATE TABLE: attribute "subfunction_file" duplicated > <<<--------!!!! > > > Please advise where is my mistake. I use: > > test=# select version(); > version > --------------------------------------------------------------------- > PostgreSQL 7.2.1 on i386-unknown-freebsd4.3, compiled by GCC 2.95.3 > (1 row) > > > Thank you, > > Igor