I've been trying to follow the example made in the cookbook, but for some 
reason, the "as"=> part doesn't seem
to be working:

my $qs=$schema->resultset('Schema::Msgs')->search({},
     {select   => [ 'quar_type',{ count => '*' } ],
      join     => [ qw/quarantined/],
      as       => [ qw/quar_type qcount/],
      group_by => [ qw/quar_type/],
     });

Here is the actualy query that gets executed:

SELECT quar_type, COUNT( * ) FROM msgs me LEFT JOIN quarantine quarantined ON ( 
quarantined.mail_id = me.mail_id ) GROUP BY quar_type

The problem is that since the as part doesn't execute, I can't do an order_by 
/qcount/, and what's even
worse, I can't get to the count!

What should I change?


_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/

Reply via email to