in reply to Using multiple values in a SQL "in" statement
Assuming you wanted the contents of @id in place of the question mark:
use strict; use warnings; my @id=(1,2,3,4,5); my $sql = "SELECT name FROM table where id in (".join( ",", @id).")"; print "$sql\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Using multiple values in a SQL "in" statement
by space_monk (Chaplain) on May 02, 2013 at 09:54 UTC | |
by sundialsvc4 (Abbot) on May 02, 2013 at 12:17 UTC | |
by hdb (Monsignor) on May 02, 2013 at 10:13 UTC |
In Section
Seekers of Perl Wisdom