On 9/1/06, Kurt Hansen <[EMAIL PROTECTED]> wrote:
> The regex worked. However, I found at better way -- alias the group
> function, e.g.
>
> $args{'select'} = "$args{'group_by'}, AVG(prices) as avg";
>
> This produces a sql statement like:
>
> SELECT t2.type, AVG(prices) as avg ...
>
> An added benefit is that the resulting list of hashes has 'avg' as a key
> in the hashes rather than AVG(t1.prices).

Yeah, I should document that technique.  All the docs say now is that
"Unprefixed columns are assumed to belong to the primary table ('t1')"
with no mention of the " as ..." trick.

-John

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to