← Back to team overview

maria-discuss team mailing list archive

Re: help - i'm not finding one sql function

 

try this:

SELECT LENGTH("banana") - LENGTH( REPLACE("banana","n",""));

or this (starting from mariadb 10):

SELECT LENGTH(REGEXP_REPLACE('banana','[^n]','')) ;

Jan

Am 19.03.2014 15:51, schrieb Roberto Spadim:
hi guys, i'm not finding a function to return how many character i have,
for example:

"banana"

i want a function that return 2 "n" characters, example:
substr_count("banana","n") => 2

sorry it a begginners question, but i didn't found it in mysql/mariadb
manual

--
Roberto Spadim
SPAEmpresarial
Eng. Automação e Controle


_______________________________________________
Mailing list: https://launchpad.net/~maria-discuss
Post to     : maria-discuss@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~maria-discuss
More help   : https://help.launchpad.net/ListHelp



References