On Fri, 2008-08-01 at 12:06 +0200, BUNK (Jacob Bunk Nielsen) wrote:
> Perhaps, but it also ignores any mentioning of 'count'. This doesn't
> seem logical to me. Do you have any idea why it ignores count?

The max is obviously causing a problem, how about a different approach?

** untested **
my $basket = $schema->resultset('shop.basket')->search(
     {basket_id => [1, 2]},
     {
      select => [ \'COUNT(me.item_id) as c' ],
      as => ['c'], 
      order_by => ['c desc'],
      'group_by' => 'me.basket_id'
     }
)->single;
print $basket->get_column('c'), "\n";
** untested **

Should get you the max count, but the method may not be to your liking.

Iain 
--------------------------------------------------------
GMG Regional Digital is part of the Guardian Media Group plc.




CONFIDENTIALITY NOTICE. The information contained in this e-mail is intended 
only for [EMAIL PROTECTED] It may contain privileged and confidential 
information that is exempt from disclosure by law and if you are not an 
intended recipient, you must not copy, distribute or take any action in 
reliance on it. If you have received this e-mail in error, you may notify us by 
telephone on 44 (0)161 832 7200. E-mail transmission cannot be guaranteed to be 
secure or error-free. The sender ([EMAIL PROTECTED]) therefore does not accept 
liability for any errors or omissions in the contents of this message, which 
arise as a result of e-mail transmission. If verification is required please 
request a hard-copy version.

Scanned by MailDefender - managed email security from intY - 
www.maildefender.net

_______________________________________________
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