I'd like to calculate a MAX() value for a column. What's the proper way to do this in sqlalchemy while preserving database independence?
+2
A:
You can find aggregate functions in:
from sqlalchemy import func
func.avg(...)
func.sum(...)
func.max(...)
In 0.5 you can use an ORM query like a select:
session.query(func.max(Table.column))
Dave
2010-03-02 10:37:31
Is this database independent?
ensnare
2010-03-02 14:43:36
I believe it is :)
Dave
2010-03-02 16:24:53
This was great. Thank you, Dave.
ensnare
2010-03-07 15:45:01