Home » SQL & PL/SQL » SQL & PL/SQL » Top two maximun dates -Urgent
Top two maximun dates -Urgent [message #21732] Mon, 26 August 2002 19:06 Go to next message
UmaSund
Messages: 22
Registered: February 2002
Junior Member
Hi

I have column with dates in them . I need to identify the second most max date. I can Identify the Max date by using the max function. How do I identify the second most max date?

How can this be achieved?

Thanks a ton in advance.

-Umasund
Re: Top two maximun dates -Urgent [message #21734 is a reply to message #21732] Mon, 26 August 2002 21:50 Go to previous messageGo to next message
Raj
Messages: 411
Registered: November 1998
Senior Member
hi,
the following query solves u'r problem.

select min(start_date) from test a where 2 >(select count(*) from test b where a.start_date<b.start_date)
Re: Top two maximun dates -Urgent [message #21743 is a reply to message #21732] Tue, 27 August 2002 08:20 Go to previous message
UmaSund
Messages: 22
Registered: February 2002
Junior Member
Thank you Raj, Todd and Manju for your replies

Problem solved.
-Umasund
Previous Topic: Row counter on multi-table view or query
Next Topic: SQL Output
Goto Forum:
  


Current Time: Fri Apr 26 11:21:13 CDT 2024