MySQL/SQL: count chars in table field

SELECT CHAR_LENGTH(field)-CHAR_LENGTH(REPLACE(field,’-',”)) AS count FROM table

Tags: , , ,