have one table with columns: ID and submission_date
now I have to select ID from this table where submission_date is latest to given date.
now I have to select ID from this table where submission_date is latest to given date.
SELECT ID,submission_date
FROM <table name>
WHERE submission_date =
(SELECT submission_date
FROM (SELECT DISTINCT submission_date,
DENSE_RANK () OVER (ORDER BY submission_date) seq_num
FROM <table name>
WHERE submission_date >
TO_DATE ('<input date>', 'YYYY-MM-DD'))
WHERE seq_num = 1)
Comment