473,404 Members | 2,137 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,404 software developers and data experts.

FETCH FIRST ROW ONLY

Hi.

Just a brief question: Are "FETCH FIRST ROW ONLY" and "FETCH FIRST x
ROWS ONLY" DB2 specific or SQL92?

thanks for any help,
nymano.

Apr 7 '06 #1
3 40458
nymano wrote:
Hi.

Just a brief question: Are "FETCH FIRST ROW ONLY" and "FETCH FIRST x
ROWS ONLY" DB2 specific or SQL92?


Definitively not SQL92. And I could find it neither in SQL:2003 or SQL:200x
(which will be the next version of the standard, hopefully in 2007).

Btw, nobody cares about the SQL92 standard any longer. SQL:2003 is the
current one.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Apr 7 '06 #2
Knut Stolze wrote:
nymano wrote:
Hi.

Just a brief question: Are "FETCH FIRST ROW ONLY" and "FETCH FIRST x
ROWS ONLY" DB2 specific or SQL92?

Submissions for the next round of the standards are on and IBM is moving
to standardize a clause. Politics typically dictate that no vendor's
existing syntax ever gets through unchanged, but syntax is easily
modified. :-)
My money is on something like mySQL's OFFSET x LIMIT y.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Apr 7 '06 #3
On Fri, 07 Apr 2006 07:22:52 -0700, nymano wrote:
Just a brief question: Are "FETCH FIRST ROW ONLY" and "FETCH FIRST x
ROWS ONLY" DB2 specific or SQL92?


"FETCH FIRST ..." is DB2's proprietary way to limit result sets.

DB2 offers SQL:2003's way, also. In fact now that MS has released MSSQL
2005, it seems that all of the "Big 3" support SQL:2003's "window
function" approach, see http://troels.arvin.dk/db/rdbms/#select-limit

--
Greetings from Troels Arvin, Copenhagen, Denmark

Apr 18 '06 #4

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

Similar topics

8
by: Evan Smith | last post by:
During a routine performance check using an event monitor, I discovered a class of query whose performance has me baffled. The monitor captured: SELECT * FROM EWM_CASE fetch first 1 rows only...
2
by: deebeetwo | last post by:
I am trying to select only a certain number of records from a table. It is easy enough with "fetch first" syntax. What complicates this a bit is the fact that I need to retrieve the number of rows...
13
by: RR | last post by:
Hi, It appears that DB2 has an arbitrary restriction on the use of "fetch first N rows". I want to insert into a table from a large table query, but only insert the first N rows: insert...
5
by: Bernd Hohmann | last post by:
Is there any way to create a dynamic row limit like "fetch first ? rows only" using the JDBC driver and a PreparedStatement? Bernd -- "Ja, alles meine Herren" sprach Fürst Lichnowsky. "Ooch...
9
by: Acupuncture | last post by:
Hi, I am developing a JDBC application and I encountered this problem (DB2 for ISeries). I want to do a select for update and also use the fetch first rows clause. This is my sql statement: ...
14
by: sangram.0149 | last post by:
hi, can someone plz help me on this one i need to fetch the first record from every group of records with the same emp id. i cannot use group by because i want to fetch all the fields...
15
by: dataguy | last post by:
I am trying to insert into a temporary table but only the first n number of rows. I thought I could use the combination of insert into and fect first row command ,but it won't work. Does anyone...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.