Search Postgresql Archives

Re: missing FROM-clause entry for table

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

 




----- "Erwin Moller" <erwin@xxxxxxxxxx> wrote:

> Hi group,
> 
> I get a mysterious errormessage while executing the following query:
> (I left the tabledefinitions out, since I think they don't matter. If
> I 
> am wrong I'll be happy to post them.)
> 
> SELECT DRV1.languageid, DRV1.categorypropertyid, 
> CPL.categorypropertylangname
> FROM (SELECT L.languageid, CP.categorypropertyid FROM tbllanguage AS
> L, 
> tblcategoryproperty AS CP) AS DRV1
> LEFT OUTER JOIN tblcategorypropertylang AS CPL ON 
> ((CLP.languageid=DRV1.languageid) AND 
    ^^^ instead of CPL

> (CPL.categorypropertyid=DRV1.categorypropertyid));
> 
> ERROR:  missing FROM-clause entry for table "clp"
> 
> While this one is working just fine:
> 
> SELECT DRV1.languageid, DRV1.categorypropertyid,
> categorypropertylangname
>     FROM (SELECT L.languageid, CP.categorypropertyid FROM tbllanguage
> AS 
> L, tblcategoryproperty AS CP) AS DRV1
>     LEFT OUTER JOIN tblcategorypropertylang ON 
> ((tblcategorypropertylang.languageid=DRV1.languageid) AND 
> (tblcategorypropertylang.categorypropertyid=DRV1.categorypropertyid));
> 
> The only difference is that I didn't use an alias CPL for 
> tblcategorypropertylang.
> (The above queries are dynamically created by PHP based on a lot of 
> other, not related, things, and I would like to use the first way 
> because that makes sense in my current project.)
> 
> I Googled a little for the errormessage, but to no avail.
> The second query is also good enough for me, but I am curious what I
> am 
> missing here.
> 
> What is causing this?
> 
> Thanks for your time.
> 
> Regards,
> Erwin Moller
> 
> -- 
> Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

Adrian Klaver
aklaver@xxxxxxxxxxx

-- 
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