十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
假设是数组形式如:需要查1,2,3,4,5,6的数据就用in :select * from table where num in(1,2,3,4,5,6)
创新互联主营莲花网站建设的网络公司,主营网站建设方案,成都App定制开发,莲花h5小程序设计搭建,莲花网站营销推广欢迎莲花等地区企业咨询
如果需要查询范围内的,如:查询1-6范围内的可以:
select * from table where num 1
and num 6
试试这样行不行:
SELECT orderId,MAX(type) AS maxtype FROM table WHERE id IN (100,101,102) GROUP BY orderId
select name from `表2` where id in (select index from `表1` where group = 'happy');
你可以用or来查询
?php
$arr = array('我', '是', '奇葩', '战斗机');
$where = '';
if(is_array($arr)){
foreach($arr as $val){
$where .=" or TITLE like '%$val%' ";
}
$where =rtrim($where, 'or'); //去掉右侧的or
}
?