Need a SQL query using joins
I need a help
Table name: RVW_TSK
RVW_ID UPC_CD CMPL_DATE
00001 10101010 10-10-2009
00002 10101010 13-10-2009
00003 20202020 5-11-2008
00004 20202020 8-11-2008
Expected result is like:
RVW_ID UPC_CD CMPL_DATE
00002 10101010 13-10-2009
00004 20202020 8-11-2008
I want the latest one (from CMPL_DATE) and no duplication of UPC_CD.
Any help would be appreciated?
This seems like a straight forward group by unless i am reading something wrong here.
Since i dont have any database to test it now..cannot vouch for the exact syntax but here goes…assuming that the CMPL_DATE is a datetime field. It might need some conversions etc if it is a string