Home  >  Q&A  >  body text

redis - mysql 搜 集合 类型的 字段,怎么定位?


type set('热血','励志','污','友情','冒险') DEFAULT NULL,

+----+--------------+
| id | type         |
+----+--------------+
|  0 | 热血,污,冒险 |
+----+--------------+

就是我只拿 type 包含 '热血' 的,当然也包含其他内容, 比如上面那条,不只有热血,还有冒险,搜索语句怎么写?

PHP中文网PHP中文网2710 days ago465

reply all(1)I'll reply

  • 阿神

    阿神2017-04-17 15:58:27

    select * from table where `type` like '%热血%';

    Like usage: http://www.w3school.com.cn/sq...

    reply
    0
  • Cancelreply