Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 how to display the sequence number?

Author  Topic 

donar
Starting Member

22 Posts

Posted - 2005-01-07 : 15:33:02
Should be a simple question for you guys.
I need the number as a temperary field can display when you search the records out.

like
temperary ID records
1 10 sth.
2 11 sth.
3 100 things
....


I do not want the temperary stored in database,just want to display it, Can you help?

Thanks a lot!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-01-07 : 15:39:56
SELECT IDENTITY(int, 1, 1) AS [temp], Column1, Column2
INTO #Temp
FROM Driver
WHERE...

SELECT * FROM #Temp

DROP TABLE #Temp



Tara
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-01-07 : 20:56:00
do this in your output, not in SQL. how are you presenting these results to your users?

- Jeff
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-01-08 : 00:53:44
Try this

Select (select count(*) from Table where Id<=T.id) as Temporary,ID,Records from Table T order by ID

Madhivanan
Go to Top of Page
   

- Advertisement -