SELECT LH.* FROM LocationHistory LH INNER JOIN (SELECT MAX(Sequence) AS Sequence, PartID, SerialNo FROM LocationHistory GROUP BY PartID, SerialNo ) Derived ON LH.Sequence = Derived.Sequence and LH.PartID = Derived.PartID and LH.SerialNo = Derived.SerialNoI want to include as part of the result set a count of all records of each PartId/SerialNo combination