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
调用:
select is_mixed('11,13','11,12,14,15,16')
结果:1