• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL question

 
shalu sharma
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to db2, I have a certain requirement where i have to select top 10 values from a table. please help me how it can be acheived. if any body knows a good book on db2 online then pls share the link with me

TIA
Shalu
 
Rajendar Goud
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
For fetching the top 10 values you can use the same normal sql query and simply append the following at the end of your query

FETCH FIRST 10 ROWS ONLY

ie select column_name from table FETCH FIRST 10 ROWS ONLY

cheers,
Raj
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic