Need help with MySQL "LIKE" string

Discussion in 'Databases' started by scarfeet, Nov 19, 2010.

  1. #1
    I am going to explain this through an example,

    Suppose I have a table called "MY_BLOG" with two columns, "BLOGPOST" and "STATUS"

    I need to update the STATUS if certain word occurs in BLOGPOST column, here's the querry I usually use for this purpose:

    running this query will set the STATUS to "0" for all the rows where BLOGPOST column has word "viagra" in it.

    Now what I need is to be able to execute query only if BLOGPOST column has the word "viagra" more than 3 times in one row.

    Any suggestions how to do it?
     
    scarfeet, Nov 19, 2010 IP
  2. scarfeet

    scarfeet Peon

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I've found a way around this, here's how it would work

     
    scarfeet, Nov 19, 2010 IP