January 10, 2009 at 2:06 am
I have joined many tables and made a select statement. I need to display serial no as first column in the result set of the query, ie. if the result set contains 10 records then the serial no column must show from 1 to 10, each no for each row or record. Is there any built in function in SQL or any other method to do this task.
I would be very thankfull if anyone suggest a solution for this.....
January 10, 2009 at 2:27 pm
Duplicate posting. It was answered here:
http://www.sqlservercentral.com/Forums/Topic633424-338-1.aspx
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
January 11, 2009 at 4:13 am
Am using SQL 2000
January 11, 2009 at 6:12 am
As I mentioned in the other thread, with SQL 2000, there isn't a really easy way to do this. You could insert the results into a temp table or table variable that has an identity column.
Could you maybe post the query and then show us what you want the output to look like?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply