On 9/7/07, Paul Johnston <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> >And if I wanted to select a year and group by year?
> >"select User.Year from User group by User.Year"
> > db.execute(select([User.Year]) ???
> >
> >
> Have a look at http://www.sqlalchemy.org/docs/04/sqlexpression.html
>
Ok.
Based on documentation.
I do:
import sqlalchemy
  s2=sqlalchemy.select([User.c.YEAR])
s3=s2.execute()

Got all year fields. 1995,1995,1995,1996,1996......
Now I want to group so I get just one.
  s2=sqlalchemy.select([User.c.YEAR]).group_by(User.c.YEAR)
But when I execute, I get:
s3=s2.execute()

Traceback (most recent call last):
  File "<console>", line 1, in ?
AttributeError: 'NoneType' object has no attribute 'execute'

In docs they use conn.execute(s2)
Is this a different execute that is being called from somewhere else?

Lucas

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to