my $rs = $schema->resultset('Thread')->search(undef, { join => 'posts', select => [qw/subject timestamp/], '+select' => \'MAX(timestamp) as tmax', '+as' => [qw/tmax/], order_by => 'tmax DESC', group_by => 'me.thread_id', }, ); foreach my $x ( $rs->all() ) { say $x->get_column('tmax') . " " . $x->subject(); }