I'm trying to create a view by selecting the 3 most recent dates from a table of dates. Is it possible to do this with max case? Sample code is very much appreciated.
I'm trying to create a view by selecting the 3 most recent dates from a table of dates. Is it possible to do this with max case? Sample code is very much appreciated.
Thanks!
select s.date from
(
select dense_rank() over (order by date desc)n,date
from
table
)s
where s.n<=3
My apology, I didn't fully explain what I am trying to do.
I have a set of data of employee numbers, events, and close_dates. The data includes several months of data. I only want to extract the most recent 3 dates for each employee. such as
Comment