目测因为你写了分组了,所以distinct不需要了。而且你为什么要count呢?
不需要count也不行吗?
你in后面的查询外边再套一层select呢,并且把limit放在外边的select条件中,即:... in (select 字段 from (你的查询)limit 6)