luke saunders <[EMAIL PROTECTED]> writes:
> BUNK (Jacob Bunk Nielsen) <[EMAIL PROTECTED]> wrote:
> [ ... ]
>> I'm trying to write the equivalent of:
>>
>> select
>> max(no_of_items) from
>> (select count(item_id) as no_of_items
>>  from shop.basket where basket_id=1 or basket_id=2
>>  group by basket_id) foo;
>>
>> [ ... ]
>
> Could be a ResultSetColumn bug. What's the SQL you are actually expecting?

Something like the above.

It has to be done with a sub select because you can't nest aggregate
functions like max() and count().

Best regards

Jacob

_______________________________________________
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