if (@id) { my $ids = join ',', map {$dbh->quote($_)} @id; $col_ref = $dbh->selectcol_arrayref(qq{SELECT val1 FROM tb11 WHERE x IN ($ids)}) }