By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE `accounts` (ID INTEGER);
INSERT INTO `accounts` (ID) VALUES
(1), (5), (15);
SET @ActID = CONCAT(CAST(5 AS CHAR),',',CAST(15 AS CHAR));
SELECT * FROM `accounts` WHERE FIND_IN_SET(`ID`,@ActID) > 0;
ID |
---|
5 |
15 |
SELECT * FROM `accounts` WHERE FIND_IN_SET(`ID`,@ActID) = 0;
ID |
---|
1 |