日期:2014-05-17 浏览次数:20681 次
DELIMITER $$ DROP FUNCTION IF EXISTS `abgent_website`.`removeHtml`$$ CREATE FUNCTION `removeHtml`(s varchar(255)) RETURNS varchar(255) BEGIN declare d int(20); declare dd int(20); declare sumstr varchar(255); while (instr(s,'<')!=0 && instr(s,'>')!=0) do set d = instr(s,'<'); set dd = instr(s,'>'); set sumstr = substr(s,1,d-1); set s = substr(s,dd+1); set s = concat(sumstr,s); end while; return s; END$$ DELIMITER ;