my $cnt_statement = "SELECT count(*) FROM ($statement)";