On Aug 24, 2007, at 10:43 AM, Curtis Scheer wrote: > What is the syntax to specify the columns in a generative query? > > > > q = session.query(Foo) > > q = q.group_by([foo_table.c.description]) > > > > for currow in q: > > print currow > > > > This query selects all the columns in the Foo table, wondering how > to specify the columns to select.
query(Foo) will always select all columns that correspond to a "Foo" object. for individual columns, use a SQL expression instead of a Query, i.e. select([foo_table.c.cola, foo_table.c.colb]).group_by (...).where(...).<etc>() . --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---