Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Getting succeeding and preceeding records
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