Hi,

Can any one help me to convert this query to SQLAlchemy sytax ?

  select * from distributions inner join (select * from comments where
  comments.id in (select max(comments.id) as id from comments group by
  comments.distribution_id)) a on distributions.id = a.distribution_id
  order by a.datetime desc

The schema is here:
https://github.com/baijum/getpython3/blob/master/py3k/model.py
May be the query can be simplified.

Regards,
Baiju M
_______________________________________________
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers

Reply via email to