When filtering some spam, I have two MYSQL statements in one file,
SET @valid_users := '"admin", "jrock", "kmicka", "First Last"'; //etc
Following SELECT, like this
SELECT AND User.user_name NOT IN (@valid_users)
When I do this, it acts as if it @valid_usersis an empty string. (Returns all results). But if I change the sentence to NOT IN ('admin', 'jrock', etc), it will work as it should.
Why NOT INdoes variable in not work?
source
share