Neil Lunn wrote:
>
>
> neil.lunn wrote
>>
>> I write the following structure in full. The problem I am having is
>> that any other combination of 'distinct' as shown in the commented parts >> throws an error. What am I missing? Okay, I'll put that down to a misunderstanding of the man page as I can clearly see that 'select' => [ { distinct => [ 'm2.inventorycategoryid', 'c2.name' ] }
will produce:

select distinct (m2.inventorycategoryid, c2.name)

Which of course is not valid SQL as this is not one column

this can be fixed again by referencing:

select => [ \"distinct m2.inventoryitemid, c2.name"]

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,
}

Matt


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to