Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: sql

Re: sql

From: Michael Gast <mig-sm_at_web.de>
Date: Tue, 24 Sep 2002 09:45:37 +0200
Message-ID: <3D901821.60201@web.de>


abhishek schrieb:
> how to write sql querry to
> 1. show the second maximum value of a column.

You could use a self join:

select max (A.<YOURCOL>)
  from <YOURTABLE> A, <YOURTABLE> B
  where A.<YOURCOL> < B.<YOURCOL>

-- 
Due to spam, this email address is only used for newsgroup postings.

All emails sent to this address are immediately deleted. Therefore any
eMails sent directly to this address never will be answered.

Mit freundlichen Grüßen / Best Regards
Michael Gast
SEPP MED GmbH
Received on Tue Sep 24 2002 - 02:45:37 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US