my $sql = "SELECT table FROM tags WHERE tag IN ('red','black')"; my $ID = $dbh->selectall_arrayref ($sql);