Search Postgresql Archives

Re: SELECT does not find table created by itself

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/1/2 Andrus <kobruleht2@xxxxxx>:
> select * FROM (select 1 as a) t2 left join t2 t3 ON TRUE
>
> causes error
>
> ERROR:  relation "t2" does not exist
>
> How to fix so that table t2 is created only once ?

Not entirely sure if this is what you're looking for, but I think a
CTE can solve your problem:
WITH t2 AS (SELECT 1 AS a)
SELECT * FROM t2 LEFT JOIN t3 ON TRUE



-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux