Search code examples
mysqlsql

How I get data in using LIKE without differentiating between uppercase And lowercase?


I'm trying to get names using Like '%BEJO%', but no record is found because my data in database is 'Bejo'.

How I do I get the name 'Bejo' with LIKE '%BEJO%'? (case insensitive)


Solution

  • Try this:

    select t1.*
    from table1 t1
    where LOWER(column_name) LIKE LOWER('%BEJO%');