SQL SELECT LIKE (Insensitive casing)

后端 未结 9 1801
野性不改
野性不改 2021-02-02 05:32

I am trying to execute the sql query:

select * from table where column like \'%value%\';

But the data is saved as \'Value\' ( V is capital ).

9条回答
  •  春和景丽
    2021-02-02 06:28

    Either use a case-insensitive collation on your table, or force the values to be lower case, e.g.

    WHERE lower(column) LIKE lower('%value%');
    

提交回复
热议问题