-2

I'm counting the occurrence of the exact word "value". I have used this code, and the result is this:

description       count
value value         2
valueses            1
val                 0

I want the results to be like this, where the sub-string of what i'm searching is not counted. In this case valueses count is 0.

description       count
value value         2
valueses            0
val                 0

Any solutions would be much appreciated thanks.

Community
  • 1
  • 1
Ahmir
  • 1
  • 2
  • Please do not link to your code, the link will eventually go away and then your question will be useless to others. Instead, include the code in the question (indent 4 spaces so it is formatted as code). – Jim Garrison Feb 07 '15 at 04:35

1 Answers1

0

MySQL has regular-expression support built-in. That could be pretty useful for weeding out false-positives if you can chop up the strings first by your own criteria for the word boundaries:

http://dev.mysql.com/doc/refman/5.1/en/regexp.html

If it were me, I'd want to make a stored function to apply boundaries and do reg-ex checks on the chunks all-at-once.

Christopher McGowan
  • 1,351
  • 10
  • 10