Home >Backend Development >PHP Tutorial >值=6,2,9,13,19时用cate_no in (二)查询不到

值=6,2,9,13,19时用cate_no in (二)查询不到

WBOY
WBOYOriginal
2016-06-13 11:15:461045browse

值=6,2,9,13,19时用cate_no in (2)查询不到
member 表里
有一个字段叫
cate_no
是字符串类型。
cate_no 值是 6,2,9,13,19 的时候。

SELECT * FROM member WHERE cate_no in  (2)

这时搜索不到这个数据,
但是
SELECT * FROM member WHERE cate_no in  (6)
时能搜索到这个数据,

cate_no in   (2)
这个MYSQL代码怎么写?



------解决方案--------------------
<br />SELECT * FROM member WHERE FIND_IN_SET(2,cate_no)<br />
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn