Let's come in and see how this sql function is optimized.

CREATE DEFINER=`root`@`%` FUNCTION `is_mixed`(str1 TEXT, str2 TEXT) RETURNS tinyint(4)
BEGIN
    DECLARE ismixed TINYINT DEFAULT 0;
    set ismixed:=(select concat(str1, ",") regexp concat(replace(str2,",",",|"), ","));
    RETURN ismixed;
    END

call:

select is_mixed("11,13","11,12,14,15,16")

result: 1

Sep.07,2021
Menu