Hello, I am trying to do a simple query which gets id, count(*) group by id,
s=sqlalchemy.select([th.RECORD_NO,sqlalchemy.func.count(th.RECORD_NO)],sqlalchemy.and_(th.APPLIED_TEST==1,th.CODING_DATE=='20080404')).group_by(th.RECORD_NO).execute() This produces: SELECT [xxxx].[RECORD_NO], count([xxxx].[RECORD_NO]) AS count_1 FROM [xxxx] WHERE [xxxx].[APPLIED_TEST] = ? AND [xxxx].[CODING_DATE] = ? GROUP BY [xxxx].[RECORD_NO] is there a way to replace this the 'count(*) as count_1' to whatever name I pick? count(*) as MY_GREAT_COUNT ??!? Also what would be a syntax to make a same selection using session.query(th)? Thanks, Lucas -- Automotive Recall Database. Cars, Trucks, etc. http://www.lucasmanual.com/recall/ Install Broadcom wireless card on Linux: http://lucasmanual.com/mywiki/bcm43xx --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---