Search Postgresql Archives

Re: Feature request

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

 





On Sun, May 4, 2008 at 12:31 AM, Scott Marlowe <scott.marlowe@xxxxxxxxx> wrote:

You have the same type of problem if you have this query:

select count(id), count(int2) from table.

They both are named count.  The simple answer is to always alias your
select fields.

select count(id) as idcount, count(int2) as intcount from table.

Of course.  This is the a limitation stemming from the CakePHP web development framework.  In this case, it would assign those two fields to an unnamed table/bucket, but for columns stemming from the from clause, it splits them into buckets based on the table alias name.  I can alias the table names, but it means rewriting all the custom queries in the app, or the resulting processing code which has been relying on the bucketizing.  Which is what I will do.  Just another small speedbump moving my app away from MySQL.

Scott


[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