Build the "where" portion of your query dynamically with a whole bunch of "or"s.
my $where = '('; for (@record_ids) { $where .= " OR " if ($where ne '('); $where .= "(record_id='$_')"; } $where .= ')'; $select = "SELECT * FROM a WHERE $where"; You get the idea..... http://danconia.org ------------------------------------------------ On Tue, 12 Nov 2002 11:34:27 -0600, "Mariusz" <[EMAIL PROTECTED]> wrote: > I would like to be able to select records from the a table where record_id and >$record_id from my @record_ids matches. I know I could go through a loop and send a >SELECT query for each element in the array but is there a better way? How can I >accomplish the same but only sending one query? > > thanks, > Mariusz > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]