SQL like search string starts with

后端 未结 4 605
失恋的感觉
失恋的感觉 2020-12-29 17:52

Learning SQL. Have a simple table games with field title. I want to search based on title. If I have a game called Age of Empires III: Dynasties, and I use

4条回答
  •  梦谈多话
    2020-12-29 18:27

    COLLATE UTF8_GENERAL_CI will work as ignore-case. USE:

    SELECT * from games WHERE title COLLATE UTF8_GENERAL_CI LIKE 'age of empires III%';
    

    or

    SELECT * from games WHERE LOWER(title) LIKE 'age of empires III%';
    

提交回复
热议问题