Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Re: Feature req...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 4 Topic 15446 of 17602
Post > Topic >>

Re: Feature request

by smiller@[EMAIL PROTECTED] ("Scott Miller") May 4, 2008 at 07:57 AM

------=_Part_643_8302781.1209905849141
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Sun, May 4, 2008 at 12:31 AM, Scott Marlowe <scott.marlowe@[EMAIL PROTECTED]
>
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

------=_Part_643_8302781.1209905849141
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<br><br><div class="gmail_quote">On Sun, May 4, 2008 at 12:31 AM, Scott
Marlowe &lt;<a
href="mailto:scott.marlowe@[EMAIL PROTECTED]
">scott.marlowe@[EMAIL PROTECTED]
>&gt;
wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid
rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><br></div>You have the same type of problem if you have this
query:<br>
<br>
select count(id), count(int2) from table.<br>
<br>
They both are named count. &nbsp;The simple answer is to always alias
your<br>
select fields.<br>
<br>
select count(id) as idcount, count(int2) as intcount from table.<br>
</blockquote><div><br>Of course.&nbsp; This is the a limitation stemming
from the CakePHP web development framework.&nbsp; 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.&nbsp; 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.&nbsp; Which is what I will
do.&nbsp; Just another small speedbump moving my app away from MySQL.<br>
<br>Scott</div></div><br>

------=_Part_643_8302781.1209905849141--
 




 4 Posts in Topic:
Feature request
smiller@[EMAIL PROTECTED]  2008-05-02 10:34:29 
Re: Feature request
tgl@[EMAIL PROTECTED] (T  2008-05-03 15:49:58 
Re: Feature request
scott.marlowe@[EMAIL PROT  2008-05-03 23:31:20 
Re: Feature request
smiller@[EMAIL PROTECTED]  2008-05-04 07:57:29 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 19:11:38 CST 2008.