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: how to find "bottom" of table in a group query

Re: how to find "bottom" of table in a group query

From: Rich Buckley <rich.buckley_at_card.co.uk>
Date: Wed, 3 Mar 1999 13:56:43 -0000
Message-ID: <7bjf2v$d4l$1@news1.cableinet.co.uk>

>But I would very much like to only see the last 10 transactions done by
>each staff_if_no.

You can do it as an anonymous PL/SQL block by creating a cusor with your query
but order the query on timestamp decending i.e. ORDER BY timestamp DESC; You then have a row counter to increment for each row fetched and exit out of the
loop when the correct number of rows have been fetched.

--Rich Received on Wed Mar 03 1999 - 07:56:43 CST

Original text of this message

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