select 'a' in ('b','a','c')
--------------------------------
1select 'a' in ('b','d','c')
--------------------------------
0
--------------------------------
1select 'a' in ('b','d','c')
--------------------------------
0
$j="1,2,3"
怎么判断出$i在$j里面
j是数据库里面的一个字段,
我是这样写的:
select * from article where $i in(j)
但是不可以。
检查值是否在一个列表里
比如
select 'a' in ('b','a','c')而你
j是数据库里面的一个字段,j="1,2,3"
注意这里的j不是一个列表,而只是一个串在mysql中有find_in_set函数来解决你的问题
select * from article where find_in_set($i, j)
为什么不用EXISTS
我是新手,EXISTS怎么来写这个句子呢。