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" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> 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



---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to