排除重复结果只取字段最大值 范例:PID相同的记录只取ID值最大的那一条。 SELECT a.* FROM [mytable] a INNER JOIN (SELECT PID,MAX(ID) as max_id FROM [mytable] GROUP BY PID DESC) b ON a.PID=b.PID AND a.ID=b.max_id;