Going crazy trying to set a variable in a query of type:
SET @idcamposexcluidos='817,803,495';
so i can then use it on a
WHERE id_campo not in (@idcamposexcluidos)
I've tried defining the variable in different formats with no luck and don't seem to find an specific example for the above:
SET @idcamposexcluidos='(817,803,495)';
...
WHERE id_campo not in @idcamposexcluidos
SET @idcamposexcluidos=817,803,495;
with no success. It either returns an error or ignores the values.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…