SQL SELECT LIKE (Insensitive casing)

后端 未结 9 1786
野性不改
野性不改 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:15

    use LOWER Function in both (column and search word(s)). Doing it so, you assure that the even if in the query is something like %VaLuE%, it wont matter

    select qt.*
    from query_table qt
    where LOWER(column_name) LIKE LOWER('%vAlUe%');
    

提交回复
热议问题