in reply to Dynamic Query

Are you asking about the SQL or the perl? I think the SQL you are looking for would use 'OR' instead of 'AND':

$sql = <<END_SQL; select comp_name from companies where company_id='10' or company_id='15' or company_id='20' END_SQL
is that what you are looking for???

-Blake