FIND_IN_SET()
FIND_IN_SET() is a SQL function in the MySQL Specific category. MySQL function that searches for a string within a comma-separated list. Returns position (1-based). The syntax is FIND_IN_SET(search_string, comma_separated_string). It accepts search_string, comma_separated_string. It returns position integer or 0. A typical example: SELECT FIND_IN_SET('b', 'a,b,c,d'); -- 2 SELECT * FROM users WHERE FIND_IN_SET('admin', permissions); -- Users with 'admin' in their permissions SET column A close relative is AUTO_INCREMENT, which mySQL auto-generates sequential integer values for this column. Commonly used with PRIMARY KEY. A close relative is ENGINE, which specifies the MySQL storage engine. InnoDB (default) supports transactions and foreign keys. MyISAM is faster for read-heavy. A close relative is LAST_INSERT_ID(), which returns the AUTO_INCREMENT value generated by the most recent INSERT in the current connection. More about this category: MySQL-specific features — AUTO_INCREMENT, ENGINE, SHOW TABLES, LIMIT. Related MySQL Specific entries: AUTO_INCREMENT, ENGINE, LAST_INSERT_ID(), ON DUPLICATE KEY UPDATE, LOAD DATA INFILE, LOCK TABLES / UNLOCK TABLES, CHARACTER SET / COLLATION, SELECT ... FOR UPDATE (MySQL).