Hi,
I'm not very good in PL/SQL and I'd like to use the ROW_NUMBER function in a subquery.
I've tried to write this query:
select x.* from
(
SELECT ROW_NUMBER() over(partition by ext_dossier_id, to_char(audit_date, 'YYYYMMDD')
order by EXT_DOSSIER_ID, audit_date desc) as Row_N,
,AUDIT_DATE
,AUDIT_ACTION
,EXTERNAL_DOSSIER_ID
,CONTRACT_ID
from dbschema.audit_ext_dossier
) X
where X.row_n = 1
but I haven't obtained the most recent record respect to the same data, also I've used ORDER BY audit_date desc in the OVER clause.
Audit_date is a datetime data and I want to get the most recent record in the same date.
Any helps to me, please?
Thanks