Anzahl an Zeichen in einem String ermitteln

ID287
Link Referencehttps://pisceansheart.wordpress.com/2008/04/15/count-occurrence-of-character-in-a-string-using-mysql/
Link CreditsNot set
Link Technical DocumentationNot set
PlCodelangMySQL
PlGroupStrings
PlItemTitleAnzahl an Zeichen in einem String ermitteln
Code-- Gets only result with 4 "/" in the the field relativePath

SELECT
id
,albumRoot
,relativePath
,date
,caption
,collection
,icon
,LENGTH(relativePath) - LENGTH(REPLACE(relativePath,'/','')) AS `occurrences`
FROM Albums
WHERE LENGTH(relativePath) - LENGTH(REPLACE(relativePath,'/',''))=4
;
Result Example