473,320 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

OFFSET function in oracle

I want to retrieve a range of record
such as retrieving 11th to 20th records from 10000 records
In SQL Server, i can use the "OFFSET" function.
so i wanna ask does Oracle provide any function similar to "OFFSET" in SQL
SERVER?

Thanks in advance
Regards
Bun
Jul 19 '05 #1
7 13453
this may help you ....

select * from mytable where rownum <= 20
minus
select * from mytable where rownum <= 10
"¢Ð¢ý¢ö" <@.@> wrote in message news:<bp**********@imsp212.netvigator.com>...
I want to retrieve a range of record
such as retrieving 11th to 20th records from 10000 records
In SQL Server, i can use the "OFFSET" function.
so i wanna ask does Oracle provide any function similar to "OFFSET" in SQL
SERVER?

Thanks in advance
Regards
Bun

Jul 19 '05 #2
"Christine" <ka******@hotmail.com> wrote...
this may help you ....

select * from mytable where rownum <= 20
minus
select * from mytable where rownum <= 10


Hi Christine,

you're kidding, right?
Jul 19 '05 #3
Well write a little PL/SQL and do it yourself. It might look less
efficient than SQL Server, but that's pretty much what it does
internally.

ETA

"Guido Konsolke" <GK@oblivion.com> wrote in message news:<10***************@news.thyssen.com>...
"Christine" <ka******@hotmail.com> wrote...
this may help you ....

select * from mytable where rownum <= 20
minus
select * from mytable where rownum <= 10


Hi Christine,

you're kidding, right?

Jul 19 '05 #4
VC
select * from
( select t1.*, rownum rn from ( select * from t1 order by x ) t1
where rownum <= upper_limit )
where rn >= lower_limit;
"¢Ð¢ý¢ö" <@.@> wrote in message news:bp**********@imsp212.netvigator.com...
I want to retrieve a range of record
such as retrieving 11th to 20th records from 10000 records
In SQL Server, i can use the "OFFSET" function.
so i wanna ask does Oracle provide any function similar to "OFFSET" in SQL
SERVER?

Thanks in advance
Regards
Bun

Jul 19 '05 #5
this question seems to pop up every few days

good solution, but don't forget to take a larger look at your application

if the user is paging thru a large set of records, consider some mechanism
to pre-select the PKs for the entire set and then use these to fetch each
page -- the performance trade off can come after only one or two pages. and
depending on your development tool, you could keep one cursor for doing the
PK fetches as needed, and use a second one for grabbing the current page of
data

-- mcs

"VC" <bo*******@hotmail.com> wrote in message
news:Vppvb.202877$275.751945@attbi_s53...
| select * from
| ( select t1.*, rownum rn from ( select * from t1 order by x ) t1
| where rownum <= upper_limit )
| where rn >= lower_limit;
|
|
| "¢Ð¢ý¢ö" <@.@> wrote in message
news:bp**********@imsp212.netvigator.com...
| > I want to retrieve a range of record
| > such as retrieving 11th to 20th records from 10000 records
| > In SQL Server, i can use the "OFFSET" function.
| > so i wanna ask does Oracle provide any function similar to "OFFSET" in
SQL
| > SERVER?
| >
| >
| >
| > Thanks in advance
| > Regards
| > Bun
| >
| >
|
|
Jul 19 '05 #6
"Guido Konsolke" <GK@oblivion.com> wrote in message news:<10***************@news.thyssen.com>...
"Christine" <ka******@hotmail.com> wrote...
this may help you ....

select * from mytable where rownum <= 20
minus
select * from mytable where rownum <= 10


Hi Christine,

you're kidding, right?


this should work ->

select rownum, * from mytable where rownum <= 20
minus
select rownum, * from mytable where rownum <= 10
Jul 19 '05 #7
how come i can't delete my meg???
THIS should work, really... ->

select rownum, col1, col2 ... from mytable where rownum <= 20
minus
select rownum, col1, col2 ... from mytable where rownum <= 10
* replace (col1, col2 ...) to whatever colname you want to select.
Jul 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: bergel | last post by:
Hello, Regarding the variable layout with multi inheritance, I looked into a couple of C++ books but I was not able to find a descent answer. Let assume I have the following: class A{ int x;...
0
by: D. Dante Lorenso | last post by:
I need to know that original number of rows that WOULD have been returned by a SELECT statement if the LIMIT / OFFSET where not present in the statement. Is there a way to get this data from PG ?...
0
by: Uthuras | last post by:
Greetings All, MAchine : INM Os : AIX 4.3.x Product : DB2 UDB Release : 6.1 DB2 seem to give the following error at the database server's console monitor continuously Feb 06...
1
by: bfirpo | last post by:
ok how can i get the register nº 10 whithout finding in all the registers of the table.? In mySQL would be: SELECT * FROM mytable LIMIT 1 OFFSET 10 In ORACLE: SELECT * FROM mytable ROWNUM 10 In...
1
verbatim
by: verbatim | last post by:
I’m having a problem with FF2.0 trying to find the y offset of an object. I've tried several different scripts; all seem to be similar to this one. I keep getting strange values for the Y offset....
8
by: colmkav | last post by:
Can someone tell me how I can access the return value of a function called from Oracle as opposed to a store proc from oracle? my oracle function is get_num_dates_varposfile. I am only used to...
5
by: ¢Ð¢ý¢ö | last post by:
I want to retrieve a range of record such as retrieving 11th to 20th records from 10000 records In SQL Server, i can use the "OFFSET" function. so i wanna ask does Oracle provide any function...
1
by: Simon429 | last post by:
Hi, I got a client application where it calls the webservices to save and retreive dates from an Oracle database. 1 problem I've encountered is that when a user select a certain date in the...
8
by: Thomas Mlynarczyk | last post by:
Hello, I want to split a given string into tokens which are defined by regexes: // example tokens - a bit more complex in real $tokens = array( 'NUMBER' ='~^\d+~', 'NAME' ='~^+~', 'ANY' ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.