IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SQL Select should return the first 10 rows


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dasan

New User


Joined: 24 Oct 2006
Posts: 10

PostPosted: Tue Oct 24, 2006 10:29 pm
Reply with quote

HI
To perform a DB2 SQL Select and only want to return the first 10 rows (no particular order). My normal query is 'SELECT * FROM tablename'. Do I need something special in my 'WHERE' clause?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue Oct 24, 2006 10:34 pm
Reply with quote

Hi there,

Please specify

fetch first n row only

Code:
SELECT * FROM table name
 FETCH FIRST 10  ROW ONLY;
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
Search our Forums:

Back to Top