select 字段一
from 表名
where 字段二 in (13,30,268)
group by 字段一
having count(字段一)=3
没太理解啊,比如字段1是商品id(id),字段二是商品类别id(subject_id),select subject_id from table where id in 3个参数,3个参数又属于subject_id的值。
select subject_id from table where id in(1,2,3)。
没理解问题是什么
where (字段1,字段2) in (
(字段1参数1,字段2参数1),
(字段1参数1,字段2参数2),
(字段1参数1,字段2参数3),
(字段1参数2,字段2参数1),
(字段1参数2,字段2参数2),
(字段1参数2,字段2参数3),
)
或者
where (
字段1=字段1参数1 and 字段2 in (字段2参数1,字段2参数2,字段2参数3)
) or (
字段1=字段1参数2 and 字段2 in (字段2参数1,字段2参数2,字段2参数3)
)