Yes, I'm using Postgres.

This does exactly what I need:

session.query(Product.attribute_x, func.min(Product.price), 
func.array_agg(func.distinct(Product.color))).group_by(Product.attribute_x)

Thanks Varun, that's saved me a real headache. I appreciate your help.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/116757f4-6b07-4c48-96da-35dd938d8049%40googlegroups.com.

Reply via email to