日期:2014-05-16 浏览次数:20781 次
mysql> select @str, length(@str) - length(replace(@str, ";", "")) as 'num'; +--------+------+ | @str | num | +--------+------+ | a;b;c;d| 3 | +--------+------+ 1 row in set
------解决方案--------------------
select length(f1)-length(replace(f1,';','')) from tt
------解决方案--------------------
select @str, length(@str) - length(replace(@str, ";", ""))