需要嵌套查询时,最好使用in子句 select * from user0 where userid in (select userid from user_server ) select * from ((select userID from user_server group by userID) as b left join user0 on b.userID=user0.userID) 这是等价的两条语句,但是优劣程度不言而喻。简单明了何乐而不为?