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

Home -> Community -> Usenet -> c.d.o.server -> Getting succeeding and preceeding records

Getting succeeding and preceeding records

From: jgippert <j_gippert_at_yahoo.com>
Date: 14 Nov 2001 01:59:43 -0800
Message-ID: <f77bf783.0111140159.34136c81@posting.google.com>


Hello everybody!

I´ve got a problem doing an SQL request to our Oracle 8i server. I´d like to do a SELECT statement, which gives me the result and the next 10 succeeding records. So I used the following stament:

select invno from fms0001.recsta where invno like '12345%' and rownum<=10

This gives me the first 10 (in this particular case) invoices-no. which start with '12345'. Now, our customer also wants to see the 10 invoice numbers that come *before* the searched number. I already tried something like ".. rownum -10" but that doesn´t seem to work. Is there a SQL-statement that does this job or do I have to make a pre-select on all records and then programm our software to do the rest of the work?

Any help on this would be very appreciated!!

Thanks in advance!

Bye,
Joerg! Received on Wed Nov 14 2001 - 03:59:43 CST

Original text of this message

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