|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Re: How to count # of character occurrences in a string?
From: Pintér Tibor (tibyke
tibyke.hu)
Date: Fri Oct 24 2008 - 17:21:06 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> I have a Char column with text data like "ab:cdef:h" and I'd like to
> count the number of ":" in the column. I can't find an easy way to do
> it. I thought there should be a MySQL function to do this. Any suggestions?
select length('aa:bb:cc:dd')-length(replace('aa:bb:cc:dd',':',''));
btw ever heard of google?
t
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]