Created
November 6, 2013 03:41
-
-
Save devacto/7330518 to your computer and use it in GitHub Desktop.
Count the number of sub-strings separated by a specified delimiter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE FUNCTION substrCount(x varchar(255), delim varchar(12)) returns int | |
return (length(x)-length(REPLACE(x, delim, '')))/length(delim); |
Author
devacto
commented
Nov 6, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment