[Dbix-class] Help with Problem with Distinct

Neil Lunn neil.lunn at trixan.com
Wed Feb 20 22:10:56 GMT 2008



Matt Lawrence wrote:
> You can pass distinct => 1 to the attributes to affect a GROUP BY 
> clause containing all columns, which should be  logically equivalent 
> to SELECT DISTINCT
>
> {
>    select => [ 'm2.inventorycategoryid', 'c2.name' ],
>    distinct => 1,
> }
>
Yes I do remember seeing that in the docs now. Thanks for the pointer.
I wonder what then is the purpose of this construct?

{
    select => [ { distinct => [ $source->columns ] } ],
}

As the array ref is parsed into : select distinct( col1, col2) ??





More information about the DBIx-Class mailing list