Skip to content
yuki-kimoto edited this page Sep 28, 2012 · 3 revisions

Count rows

DBIx::Custom Documents >

Count rows by count method.

my $count = $dbi->count(table => 'book', where => {title => 'Perl'});

Options is same as select method's ones .column option is set to count(*) by default. This is same as the following select method.

my $count = $dbi->select('count(*)', table => 'book', where => {title => 'Perl'})->value;
Clone this wiki locally