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?
>
> 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
> GROUP BY c.model
> HAVING max_cost > 10
>
> Any hints?
>
> Thanks,
> -Samuel
>
>
> ---------------------------------------------------------------------- 
> ---
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to  
> share your
> opinions on IT & business topics through brief surveys -- and earn  
> cash
> http://www.techsay.com/default.php? 
> page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Sqlalchemy-users mailing list
> Sqlalchemy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to