Login | Register
My pages Projects Community openCollabNet

Discussions > users > Table "aliasing" ??

propel
Discussion topic

Back to topic list

Table "aliasing" ??

Reply

Author Wolfgang Drews <drews at dynamicwebpages dot de>
Full name Wolfgang Drews <drews at dynamicwebpages dot de>
Date 2005-05-15 14:41:12 PDT
Message hi list,

just a short question i can't find an answer in the archives etc ...

i have a query, which self-joins two tables. For that the one table
is aliased with "a", the second with "b". Now, when i create the
sql-statement in the following way:
"
SELECT a.*, round((a.".ObjectTre​ePeer::OBJECT_TREE_R​GT) AS alias_X,
(a.".ObjectTreePeer:​:OBJECT_TREE_LFT." - b.".ObjectTreePeer::​OBJECT_TREE_LFT.") AS alias_Y
FROM ".ObjectTreePeer::TABLE_NAME." a, ".ObjectTreePeer::TABLE_NAME." b
"
it doesnt work, as it results in a mysql-error "doesnt know a.tablename.column".
(ofcourse it does).

Only workaround is to just use the constant only ("OBJECT_TREE_RGT"), which
results in a notice -> but this is actually not wanted or to use the columnnames
directly but thats something, i just dont want either.

can you help me?

best regards

-Wolfgang

--
PHP-Centralpoint Dynamic Web Pages: http://www.dynamicwebpages.de/
German PHP-Certification: http://www.phpzertif​izierung.de/

« Previous message in topic | 1 of 6 | Next message in topic »

Messages

Show all messages in topic

Table "aliasing" ?? Wolfgang Drews <drews at dynamicwebpages dot de> Wolfgang Drews <drews at dynamicwebpages dot de> 2005-05-15 14:41:12 PDT
     RE: [propel] Table "aliasing" ?? =?iso-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?iso-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2005-05-15 15:33:12 PDT
     Re: [propel] Table "aliasing" ?? Sven Fuchs <svenfuchs at artweb-design dot de> Sven Fuchs <svenfuchs at artweb-design dot de> 2005-05-15 16:24:51 PDT
         RE: [propel] Table "aliasing" ?? =?iso-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?iso-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2005-05-15 16:29:33 PDT
         Re[2]: [propel] Table "aliasing" ?? Sven Fuchs <svenfuchs at artweb-design dot de> Sven Fuchs <svenfuchs at artweb-design dot de> 2005-05-15 16:43:08 PDT
             RE: Re[2]: [propel] Table "aliasing" ?? =?iso-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?iso-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2005-05-15 18:01:57 PDT
Messages per page: