Re: character occurrence count in MySQL

2002-07-15 Thread Ralf Narozny
Hello! The regexp to match only 2 occurences of ';' would be: regexp '^[^;]*;[^;]*;[^;]*$' to find the number of ';' I only have an idea for something complicated: length() - length(replace(,';','')) StephanieTan wrote: >Hi all, >I am looking for a way to count the number of a character occu

character occurrence count in MySQL

2002-07-15 Thread StephanieTan
Hi all, I am looking for a way to count the number of a character occurrences in a string with MySQL. For example, I have this string "1;333;72227;00;19;1;1;" and I would like to return the number of ";" found in this string. Is this possible? Also, I wanted to return fields that contain EXACTLY 2