Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to get the serial number from a result 1

Status
Not open for further replies.

123Hai

IS-IT--Management
Dec 30, 2002
6
0
0
IN
Hi , I would like to get the serial numbers of the rows fetched from a query like
select * from table1;

slno field1 field2...
------------------------------
1 abc jjj
2 def kji
3 ghi ....
4....


If I get this from db2 ,I neednot have to a temp counter in the jsp or java pgm when i show the report....

Regards,
Sriram
 
Hi Sriram,
hat you probably want is ROWID. This is not available in all versions of DB2, so you'll have to try it and see.

You can find out a little more in thread178-307573

Hope this helps
Marc
 
Hi,
Happy New Year!.. I think interpretation of the question is bit wrong. What i want is continuous sl numbers for the result set , not the stored row id. I can have a query which joins 2 or more tables also . But the results should have serial numbers like 1 , 2,3.. which we can directly display in the report.

In short we get the number of rows selected after each query in any DBMS. Eg. 10rows affected.
I want each row to be numbered as 1, 2, 3 and so on...

How to get this?

Regards,
Sriram
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top