Thanks Vishal and  veerendra jotle .
I need to use rowid as i didn't get any other solution


Select Salary from tablename where rownum<=5 order by salary desc;
instead of order by salary we have to use order by rowid


 thanks a lot..


----- Original Message -----
From: "Vishal Chaddha" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 03, 2003 6:25 PM
Subject: Re: displaying 5th record


> Hi Priti,
>
> You can execute following query from your JSP
>
> Select Salary from tablename where rownum<=5 order by salary desc;
>
> This will first arrange records in descending order of Salary and then
limit
> the count of records to 5. Data in first Record fetched would be highest
> among thee five records.
>
> Hope this helps.
> Vishal
>
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED] Behalf Of Priti Chhetri
> Sent: Tuesday, June 03, 2003 4:23 PM
> To: [EMAIL PROTECTED]
> Subject: displaying 5th record
>
>
> Hi All,
>
> I need to take out last 5 records from the table  and without using any
> condition and then I have display highest salary from retrieved Records in
> JSP as I have one column as Salary .(using Oracle ).Quick answer would be
> very much helpful
>
>
>
> thanks
> Priti
>
> =========================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
>
> Some relevant archives, FAQs and Forums on JSPs can be found at:
>
>  http://java.sun.com/products/jsp
>  http://archives.java.sun.com/jsp-interest.html
>  http://forums.java.sun.com
>  http://www.jspinsider.com
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
>
> Some relevant archives, FAQs and Forums on JSPs can be found at:
>
>  http://java.sun.com/products/jsp
>  http://archives.java.sun.com/jsp-interest.html
>  http://forums.java.sun.com
>  http://www.jspinsider.com
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

Reply via email to