Home » SQL & PL/SQL » SQL & PL/SQL » How can we get row x to row y in a resultset using SQL Standard?
How can we get row x to row y in a resultset using SQL Standard? [message #424154] Wed, 30 September 2009 06:18 Go to next message
manns
Messages: 59
Registered: March 2006
Location: Bangalore
Member

Q1. How can we get row x to row y in a resultset using SQL Standard?
A. It is not possible, we have to iterate through resultset and get it
B. SELECT... FROM ... WHERE ... ORDER BY ... OFFSET x ROWS FETCH FIRST y ROWS ONLY
C. SELECT ...BETWEEN (x, y) FROM ... WHERE ... ORDER BY ...
D. SELECT... FROM ... WHERE ... and ROW_NUM > x and ROW_NUM < y ORDER BY ...
Re: How can we get row x to row y in a resultset using SQL Standard? [message #424162 is a reply to message #424154] Wed, 30 September 2009 06:30 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
All are wrong in Oracle.

Regards
Michel
Re: How can we get row x to row y in a resultset using SQL Standard? [message #424163 is a reply to message #424154] Wed, 30 September 2009 06:30 Go to previous messageGo to next message
pablolee
Messages: 2836
Registered: May 2007
Location: Scotland
Senior Member
This is a nonsensical question. Clarify what you mean.
Re: How can we get row x to row y in a resultset using SQL Standard? [message #424164 is a reply to message #424154] Wed, 30 September 2009 06:31 Go to previous messageGo to next message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
You can use ROWNUM in sub-query to get required rows, but that is not specified in options.

regards,
Delna
Re: How can we get row x to row y in a resultset using SQL Standard? [message #424168 is a reply to message #424154] Wed, 30 September 2009 07:03 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
You can use the row_number analytic function, but that isn't part of standard SQL
Previous Topic: Extract a Specific Pattern From Random Data
Next Topic: subscript error
Goto Forum:
  


Current Time: Fri Dec 09 09:29:30 CST 2016

Total time taken to generate the page: 0.11250 seconds