[sqlalchemy] Re: SelectResults and GROUP_BY or DISTINCT?

2007-02-08 Thread isaac

Thanks, that looks like it will help. Hope the next release is soon. :)

On Feb 8, 2007, at 3:09 AM, King Simon-NFHD78 wrote:

>
> I don't use postgres, so I don't know for certain, but that error
> message looks like the one described in this message:
>
> http://groups.google.com/group/sqlalchemy/msg/f4f47510b76720c9
>
> If it is that case, I think it was fixed in rev 2301, and 2302 added a
> more convenient way to use DISTINCT with SelectResults.
>
> http://www.sqlalchemy.org/trac/changeset/2301
> http://www.sqlalchemy.org/trac/changeset/2302
>
> Hope that helps,
>
> Simon
>
>> -Original Message-
>> From: sqlalchemy@googlegroups.com
>> [mailto:[EMAIL PROTECTED] On Behalf Of isaac
>> Sent: 08 February 2007 00:32
>> To: sqlalchemy@googlegroups.com
>> Subject: [sqlalchemy] SelectResults and GROUP_BY or DISTINCT?
>>
>>
>> Hi,
>>
>> I couldn't find any mention of this in the docs or by googling...
>>
>> I'm using SelectResults to build somewhat complex queries
>> that have a string of joins. It seems that order_by doesn't
>> work in this situation. Postgres says:
>>
>> ERROR:  column "people.name_last" must appear in the GROUP BY
>> clause or be used in an aggregate function
>>
>> Any ideas or a quick example of adding a group_by to a
>> SelectResults?
>> According to some discussion in the Postgres docs, adding
>> DISTINCT might allow ORDER_BY to work (don't see a way to do
>> that either).
>> Either way is fine w/me. :)
>>
>> (I would have just given up and used another method, but I'm
>> using the @paginate decorator in TurboGears, which currently requires
>> SelectResults)
>>
>> Thanks.
>> --i
>>


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: SelectResults and GROUP_BY or DISTINCT?

2007-02-08 Thread King Simon-NFHD78

I don't use postgres, so I don't know for certain, but that error
message looks like the one described in this message:

http://groups.google.com/group/sqlalchemy/msg/f4f47510b76720c9

If it is that case, I think it was fixed in rev 2301, and 2302 added a
more convenient way to use DISTINCT with SelectResults.

http://www.sqlalchemy.org/trac/changeset/2301
http://www.sqlalchemy.org/trac/changeset/2302

Hope that helps,

Simon 

> -Original Message-
> From: sqlalchemy@googlegroups.com 
> [mailto:[EMAIL PROTECTED] On Behalf Of isaac
> Sent: 08 February 2007 00:32
> To: sqlalchemy@googlegroups.com
> Subject: [sqlalchemy] SelectResults and GROUP_BY or DISTINCT?
> 
> 
> Hi,
> 
> I couldn't find any mention of this in the docs or by googling...
> 
> I'm using SelectResults to build somewhat complex queries 
> that have a string of joins. It seems that order_by doesn't 
> work in this situation. Postgres says:
> 
> ERROR:  column "people.name_last" must appear in the GROUP BY 
> clause or be used in an aggregate function
> 
> Any ideas or a quick example of adding a group_by to a 
> SelectResults?  
> According to some discussion in the Postgres docs, adding 
> DISTINCT might allow ORDER_BY to work (don't see a way to do 
> that either).  
> Either way is fine w/me. :)
> 
> (I would have just given up and used another method, but I'm 
> using the @paginate decorator in TurboGears, which currently requires
> SelectResults)
> 
> Thanks.
> --i
> 
> 
> > 
> 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---