Case Insensitivity not working with character(255) data type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ps1986
    New Member
    • Apr 2012
    • 1

    #1

    Case Insensitivity not working with character(255) data type

    Scenario is

    "select * from table1 where name ='Anand Vihar'
    name is a field having datatype as character(255)

    To Ask:
    Now user can enter as Anand Vihar,anand vihar,AnaND viHAR any way
    so how would i achieve case insensitivity when this datatype is used it works fine when datatype is text(ilike is solving for the same ) but for this case what should i do and don't want to search like Anand Vihar ATM match should be exact but with case insensitivity
  • rski
    Recognized Expert Contributor
    • Dec 2006
    • 700

    #2
    try like this
    Code:
    select * from table1 where trim(name) ilike 'Anand Vihar'

    Comment

    Working...