Hi, query.count().scalar()
This code works fine with sqlite and Oracle, but with PG it goes nuts and complains that an explicit "AS" must be used in a subselect, i.e. it's doing this: select count(*) as blah from (select ...) But PG wants this: select count(*) as blah from (select ...) as boom Doing this fixes the problem: query.alias().count().scalar() But to me this seems like a deficiency in the dialect - shouldn't the "AS" be added automagically ? >>> sqlalchemy.__version__ '0.5.0rc4' It's no biggie but seems worth pointing out in case you weren't aware of it. Thanks. :-) -- -------------------------- Bob Farrell pH, an Experian Company www.phgroup.com Office Line: 020 7598 0310 Fax: 020 7598 0311 -------------------------- --~--~---------~--~----~------------~-------~--~----~ 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 sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---