Kamran wrote:


my @ids = (1,2,3) ;

my $SQL = "select * from students where id in (@ids)";

Instead use:

  my $SQL = 'SELECT * FROM students WHERE id NOT IN ('
          . join ',' , @ids
          . ')'
          ;

Because a) you want NOT IN and b) The values inside the parens of the IN predicate must be comma-separated.

--
Jeff

Reply via email to