What database are you using?
Some databases might support this natively, others would have to be emulated by the ORM.
I’m not a big user of the ORM, so someone else would have to help you with that.
If you’re using Postgres, then the array_agg function on the color column will give you exactly what you want.
I imagine that without an array_agg like function, two queries would have to be executed.
One to get the minimum price, the other to get a list of the colors using the logic that sqlalchemy ORM has to group rows into a list.
Then the results of these two queries would have to be presented as your result.
I’m curious to know if that’s possible with the ORM.
Thank you Varun - what you've shown in the table is exactly what I'm looking for.
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+...@googlegroups.com.