[Dbix-class] Using 'DISTINCT ON' clause in select statement

John Siracusa siracusa at mindspring.com
Sat Aug 19 00:32:11 CEST 2006


On 8/18/06 4:59 PM, Mark Blythe wrote:
> On 8/18/06, John Siracusa <siracusa at mindspring.com> wrote:
>> Now guess what value c will have in the row returned by this query:
>> 
>>     SELECT a, SUM(b), c FROM t GROUP BY a;
>> 
>> Good old MySQL...
> 
> Sure, the columns you select must have unique values per group.  That
> limitation used to be stated in the MySQL docs.

Now if only that requirement could be enforced somehow...maybe by, oh, I
don't know, the database software or something.

-John





More information about the Dbix-class mailing list