sql like condition help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kkshansid
    New Member
    • Oct 2008
    • 232

    sql like condition help

    select*from employ where name like '%roy%'
    result is
    adf roy dff
    asd roy
    roy fgg
    suproyto
    i want that only roy on spaces on both sides should come as result
    as in my example suproyto should not come in result
    kindly suggest any modification in query
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    Code:
    select * from employ where name like '% roy %'
    Don't think MySQL ignores whitespace

    Comment

    • dgreenhouse
      Recognized Expert Contributor
      • May 2008
      • 250

      #3
      code green is correct...

      What your query is requesting is:
      Return all records from employ where 'space roy space' is found in name...

      Comment

      Working...