Title: RE: oracle last
select name, sal
from (select rownum rnum, name, sal
from emp
order by sal asc)
where rownum 4
/
???
Raj
Rajendra dot Jamadagni at nospamespn dot com
All Views expressed in this email are strictly personal.
QOTD: Any clod can have facts, having an opinion is an art !
-Original Message-
From: Daniel Fink [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 14, 2003 5:54 PM
To: Multiple recipients of list ORACLE-L
Subject: Re: oracle last
Depending upon the version, you may be able to use the analytical functions (8.1.6+) to achieve what you want. I don't have a ready example, but the Oracle docs are pretty good. If you want a less elegant solution, use an inline query, sort by the reverse order (asc or desc depends on your requirements) and take the top 3. You can find examples of the Top-N approach on www.optimaldba.com/library.html. Either the Top-N Row or SQL Scripting Sorcery paper/presentation will have enough info to solve
the problem.
pfeffer wrote:
hi
is there a statement like last in mysql ?
last returns a specified number of rows from a select.
means if i do a select and i want only the last 3 lines.
thx
martin
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
*This e-mail
message is confidential, intended only for the named recipient(s) above and may
contain information that is privileged, attorney work product or exempt from
disclosure under applicable law. If you have received this message in error, or are
not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000
and delete this e-mail message from your computer, Thank
you.*1