Re: CREATE VIEW ERROR

From: "Igor" <kryltsov(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: CREATE VIEW ERROR
Date: 2003-01-23 05:00:45
Message-ID: b0nstr$1ehk$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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" <kryltsov(at)yahoo(dot)com> wrote in message
news:d418ccf3(dot)0301181703(dot)57244c80(at)posting(dot)google(dot)com(dot)(dot)(dot)
> 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

Browse pgsql-sql by date

  From Date Subject
Next Message Ries van Twisk 2003-01-23 08:08:24 Re: To use a VIEW or not to use a View.....
Previous Message smoghe 2003-01-23 01:14:48 DBCC CheckIdent in a stored proc?