select length('aa:bb:cc:dd')-length(replace('aa:bb:cc:dd',':','')); स्रोत:http://lists.mysql.com/mysql/215049