I have a problem with a SQL.
I have this SQL bellow that i use to pull resources from a table.
The thing is that in TL_RESOURCE_TRLR A
i may have multiple A.TRLR_TYPE_ID
based on A.EFFECTIVE
So i only want to extract the most updated effective date per TRLR_TYPE_ID and not all the effective dates even the old one. Just the very last one
How can i update this?
Thanks again for your help
SELECT DISTINCT A.CARRIER_ID,
FROM TL_RESOURCE_TRLR A, CARRIER_EQUIP B
WHERE A.CARRIER_ID = B.CARRIER_ID(+)
AND A.TRLR_TYPE_ID = B.TRLR_TYPE_ID(+)
AND B.CARRIER_ID IS NULL -- EXCLUDE ROWS ADDED BECAUSE OF THE OUTER JOIN
ORDER BY A.CARRIER_ID ASC;