Hello,

I'm trying to build a query to select DISTINCT column values from a table.

Originally I tried:

        sr = cls.select(sqlbuilder.AND(
                cls.q.status=='onsale', 
                cls.q.itemtype == itemtype), 
                orderBy=cls.q.added)
        sr = sr.distinct()

This doesn't work because result SQL contains multiple columns in SELECT clause 
and naturally DISTINCT won't work.

Is there a way to select DISTINCT column values from a table without resorting 
to write SQL by hand?

IMO, it'd be great if SelectResults.distinct just accepted column and then put 
it into SELECT clause.



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to