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 目标计数模型训练过程中的问题
  • ¥100 Acess连接SQL 数据库后 不能用中文筛选
  • ¥15 用友U9Cloud的webapi
  • ¥20 电脑拓展屏桌面被莫名遮挡
  • ¥20 ensp,用局域网解决
  • ¥15 Python语言实验
  • ¥15 我每周要在投影仪优酷上自动连续播放112场电影,我每一周遥控操作一次投影仪,并使得电影永远不重复播放,请问怎样操作好呢?有那么多电影看吗?
  • ¥20 电脑重启停留在grub界面,引导出错需修复
  • ¥15 matlab透明图叠加
  • ¥50 基于stm32l4系列 使用blunrg-ms的ble gatt 创建 hid 服务失败