以逗號分隔的字符串是否交集函數

delimiter $$

use `tzjob`$$

drop function if exists `is_mixed`$$

create definer=`root`@`localhost` function `is_mixed`(str1 text,str2 text) returns tinyint(4)
begin
	declare ismixed tinyint default 0;
	set ismixed:=(select concat('#',replace(str1,',','#|#'),'#') regexp concat('#',replace(str2,',','#|#'),'#'));
	return ismixed;
end$$

delimiter ;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章