SELECT * FROM DEP where pid in
case when 参数='46' then ('46,102')
when 参数='47' then ('47,158')
end
SELECT * FROM DEP where (pid in ('46,102') and 参数='46') or pid in ('47,158') and 参数='47';
SELECT * FROM DEP where
case when 参数='46' then pid in(46,102)
when 参数='47' then pid in (47,158)
end
把pid in 放到case里边,还有就是in的条件中,不要用引号,不然认为是一个字符串