Re: [GENERAL] missing FROM-clause entry for table
Raymond O'Donnell schreef: On 12/11/2008 18:08, Erwin Moller wrote: LEFT OUTER JOIN tblcategorypropertylang AS CPL ON ((CLP.languageid=DRV1.languageid) AND (CPL.categorypropertyid=DRV1.categorypropertyid)); ERROR: missing FROM-clause entry for table "clp" You've a typo in the query - the table alias is CPL, not CLP. Oh my /me slaps head against the wall. And I checked that query 2 times before posting here Maybe it is time to call it a day. ;-) Thanks Ray! (And Adrian) Regards, Erwin Moller Ray. -- Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland [EMAIL PROTECTED] Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals -- -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] missing FROM-clause entry for table
- "Erwin Moller" <[EMAIL PROTECTED]> 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@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general Adrian Klaver [EMAIL PROTECTED] -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] missing FROM-clause entry for table
On 12/11/2008 18:08, Erwin Moller wrote: > LEFT OUTER JOIN tblcategorypropertylang AS CPL ON > ((CLP.languageid=DRV1.languageid) AND > (CPL.categorypropertyid=DRV1.categorypropertyid)); > > ERROR: missing FROM-clause entry for table "clp" You've a typo in the query - the table alias is CPL, not CLP. Ray. -- Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland [EMAIL PROTECTED] Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals -- -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
[GENERAL] missing FROM-clause entry for table
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 (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@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] missing FROM-clause entry
m == [EMAIL PROTECTED] writes: m> you didn't reference the table "replica"... this should work: m> UPDATE model_timemap m> SET map = updatemap( CASE WHEN replica = 32188 THEN 328787 WHEN replica = m> 32191 THEN 5739 ELSE -1 END, 1161642129, map) m> FROM replica m> WHERE replica.replica_id = model_timemap.replica AND replica.proxy = 32189 Ah. Thanks. -- Brandon ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [GENERAL] missing FROM-clause entry
you didn't reference the table "replica"... this should work: UPDATE model_timemap SET map = updatemap( CASE WHEN replica = 32188 THEN 328787 WHEN replica = 32191 THEN 5739 ELSE -1 END, 1161642129, map) FROM replica WHERE replica.replica_id = model_timemap.replica AND replica.proxy = 32189 - Original Message - From: "Brandon Metcalf" <[EMAIL PROTECTED]> To: Sent: Tuesday, October 24, 2006 12:35 AM Subject: [GENERAL] missing FROM-clause entry Just upgraded to 8.1.5 and the following UPDATE causes the "missing FROM-clause entry" error: UPDATE model_timemap SET map = updatemap( CASE WHEN replica = 32188 THEN 328787 WHEN replica = 32191 THEN 5739 ELSE -1 END, 1161642129, map) WHERE replica.replica_id = model_timemap.replica AND replica.proxy = 32189 From what I've read, this typically results from referring to a table instead of it's alias, but I don't see how that applies here. -- Brandon ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/ ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
[GENERAL] missing FROM-clause entry
Just upgraded to 8.1.5 and the following UPDATE causes the "missing FROM-clause entry" error: UPDATE model_timemap SET map = updatemap( CASE WHEN replica = 32188 THEN 328787 WHEN replica = 32191 THEN 5739 ELSE -1 END, 1161642129, map) WHERE replica.replica_id = model_timemap.replica AND replica.proxy = 32189 >From what I've read, this typically results from referring to a table instead of it's alias, but I don't see how that applies here. -- Brandon ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/