Thursday 16 May 2019

second highest date:

WITH T AS
(select creation_date,DENSE_RANK() OVER (ORDER BY CREATION_DATE asc) AS Rnk from (select unique to_char(RCT.CREATION_DATE,'YYYY-MM-DD') as "CREATION_DATE" from
EGP_SYSTEM_ITEMS_VL ESI,
PO_LINES_ALL PLA,
RCV_TRANSACTIONS RCT
where PLA.item_id=esi.inventory_item_id
and RCT.PO_LINE_ID=pla.PO_LINE_ID
and item_number='92737'
order by CREATION_DATE asc))
select creation_date from T
WHERE Rnk =2

No comments:

Post a Comment