日期:2014-05-16 浏览次数:20748 次
select a.* from 表结构如下 a inner join 表结构如下 b on a.goods_id=b.goods_id where a.category_id=3 and b.category_id=4
------解决方案--------------------
select goods_id,count(*)
from (
select goods_id,category_id
from mytable
group by goods_id,category_id
) r
group by goods_id
having count(*)>1;