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

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

WBOY
Release: 2016-06-13 12:53:08
Original
1160 people have browsed it

值=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 />
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template