多条件查询,该怎么处理
多条件查询
select id,cid,name from table where............. order by id desc
我想要的条件是cid=1 必须的
and id=10,id=20,id=30的都要查出来
------解决方案--------------------
where cid=1 and id in(10,20,30)
select id,cid,name from table where............. order by id desc
我想要的条件是cid=1 必须的
and id=10,id=20,id=30的都要查出来
------解决方案--------------------
where cid=1 and id in(10,20,30)