wood burning stoves 2.0*
The moose likes JDBC and the fly likes SQL question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL question" Watch "SQL question" New topic
Author

SQL question

shalu sharma
Ranch Hand

Joined: Sep 09, 2002
Posts: 51
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

Joined: Mar 06, 2002
Posts: 220
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL question
 
Similar Threads
WAS and DB2 connectivity details
DB2 512
Difference between DB2 and SQL
Migrate Repository configuration
WAS 3.5 -> DB2 7.1 or 6.1, IBM JDK 1.2.2 or 1.3