现在需要查询的语句 如: select * from student s where s.name in (集合) limit 0,10;
这个集合中 包含着学生的姓名。怎样在sql中遍历出这个集合中包含的姓名
让是s.name in 等于具体的几个学生姓名 查出结果??? 救急
不用in,用FIND_IN_SET,自己查一下这个函数吧
10个,你limit0,10是决定了学生的个数。
不考虑效率的话,你的 SQL 就可以满足,不清楚你的问题是什么
在传入参数前进行集合的操作,转换成字符串,或者像一楼说的,用FIND_IN_SET(s.name,集合)
select * from student s where s.name in ( select s.name from student s where s.name like '%三%') limit 0,10;
按照当前 in 应该可以满足条件