Hi. Since docs for sqlalchemy isn't a clear doc for the beginners I
can't find out the way I could implement such a query:
SELECT extract(week from to_timestamp(min(datetimeinteger))) as min,
extract(week from to_timestamp(max(datetimeinteger))) as max from
logtable

Database is PGSQL.

meta.Session.query(sql.func.extract('week', sql.func.to_timestamp
(sql.func.min(LogObject.datetimeinteger))),\
                                  sql.func.extract('week',
sql.func.to_timestamp(sql.func.max(LogObject.datetimeinteger)))).one()

Such a construction leads to exception:
AttributeError: 'Query' object has no attribute 'min'

though I've seen examples people used func.min()

Is there any magic building such a query using ORM?

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to