2008/8/27 Cecil Westerhof <[EMAIL PROTECTED]>: > By the way is there a method to put an AS part in the select? > For example: > ##### >> stmt = sa.select([sa.func.max(KmStand.eindStand)]) >> print stmt > SELECT max("kmStand"."eindStand") AS max_1 > FROM "kmStand" > ##### > > I would like to have: > ##### > SELECT max("kmStand"."eindStand") AS eindStand > FROM "kmStand" > #####
I found a way. Maybe not the best, but it works. ##### stmt = sa.text('SELECT MAX(kmStand.eindStand) AS eindStand FROM kmStand', bind = KmStand.c.datum.table.metadata.bind) row = stmt.execute().fetchone() print row.eindStand ##### -- Cecil Westerhof --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---