Re: [Sqlalchemy-users] GROUP BY ... HAVING using SQLAlchemy expressions

2006-09-26 Thread Michael Bayer
the select() function should have group_by and having keyword arguments. On Sep 25, 2006, at 10:14 PM, Samuel Abels wrote: > Hi, > > I have not found this covered by the docs (or Google): How do you > implement "GROUP BY" and "GROUP BY xyz.id HAVING ..." statements using > Python expressions? > >

[Sqlalchemy-users] GROUP BY ... HAVING using SQLAlchemy expressions

2006-09-26 Thread Samuel Abels
Hi, I have not found this covered by the docs (or Google): How do you implement "GROUP BY" and "GROUP BY xyz.id HAVING ..." statements using Python expressions? E.g., I want to do the following: SELECT e.name, c.model, MAX(c.cost) max_cost FROM employee e LEFT JOIN car c ON c.employee_id=e.id GR