mmm, I have some code like this:
my $it = $dbic_data->resultset('table_name')->search( {
want => $want,
}, {
select => [ 'a', 'b', { max => 'c' } ],
as => [ 'a', 'b', 'max_cid' ],
group_by => [qw/ a b /],
order_by => 'max_cid DESC',
page => 1,
rows => 10
} );
debug info shows:
DBIx::Class::ResultSet::all(): Error executing 'SELECT a, b, MAX( c )
FROM table_name me WHERE ( want = ? ) GROUP BY a, b ORDER BY max_cid
DESC LIMIT 10': Unknown column 'max_cid' in 'order clause' at
seems as => is not working? my code is anything wrong?
When I comment the "order_by => 'max_cid DESC', it complains like this:
|
DBIx::Class::ResultSet::pager(): Error executing 'SELECT COUNT(
DISTINCT( a, b ) ) FROM table_name me WHERE ( want = ? )': Operand
should contain 1 column(s) at
I don't know why? mm, I tried |0.06999_05
<http://search.cpan.org/%7Ejguenther/DBIx-Class-0.06999_05/> and
0.06003, both no luck.
Thanks in advanced.
--
Fayland Lam // http://www.fayland.org/
_______________________________________________
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/
Searchable Archive: http://www.mail-archive.com/[email protected]/