douba6365 2013-07-22 06:45 采纳率: 100%
浏览 47
已采纳

使用LIKE在mysql中搜索确切的单词

please help., Lets say I want to search the word "INK"

when I use LIKE Im getting every word the has the "INK" letters on it including "wrINKled".,

if I use REGEXP I will only get results that has the word 'INK" as the first word.,

I need to be able to search the exact word for example "BLAAAH INK Blah" this product will show because it has the word ink., so as "INK blah blah"..

I cant use FULLTEXT is there a way to do this using LIKE..?

Thank you in advance.. :)

  • 写回答

4条回答 默认 最新

  • douwang4374 2013-07-22 06:46
    关注

    The query will be

    SELECT * FROM table_name
    WHERE column_name LIKE 'INK %' 
        OR column_name LIKE '% INK' 
        OR column_name LIKE '% INK %'
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!