Monday, March 3, 2008

Finding the number of occurances of a value in a string

I blogged this query before but couldn't find it in this blog, so I'm putting it here. This is for looking for the number of occurances of a particular String within a string (for looking for number of commas etc...):

select length(STRING])-Nvl(length(replace(STRING,'WHAT YOURE LOOKING FOR')),0) from dual;

No comments: