On Nov 29, 2009, at 21:10 , Diego Woitasen wrote: > I discovered that func.if_() works. > > count_ip = func.if_(MiniAccess.proxy_user_id == dash_id, > > func.count(MiniAccess.address_id.distinct()), 0)
Note that IF is a MySQL-ism, whereas CASE works on most databases. > I looks like func.foo() are translated to SQL FOO(), with the same arguments. The docs rarely lie - http://www.sqlalchemy.org/docs/06/sqlexpression.html#functions :-) -- Alex Brasetvik -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. 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.
