select p.smallimg,p.id,p.name,p.prod_cd,p.marketprice,p.multi_pic from productsort c right outer join product p on p.productsort=c.id where c.fatherid=187 and p.smallimg in(select distinct smallimg from product) order by p.id desc
我测试过,不行,
当然只是用select distinct smallimg from product 是可以的
我又用
select distinct p.smallimg,p.id,p.name,p.prod_cd,p.marketprice,p.multi_pic from productsort c right outer join product p on p.productsort=c.id where c.fatherid=187 也不行