SELECT B.RVW_ID, B.UPC_CD, B.CMPL_DATE
FROM (SELECT UPC_CD, MAX(CMPL_DATE) CMPL_DATE
FROM RVW_TSK
GROUP BY UPC_CD)TBL JOIN RVW_TSK B
ON TBL.UPC_CD = B.UPC_CD AND TBL.CMPL_DATE = B.CMPL_DATE
Baaju
2010-07-01 14:39:19