August 25, 2006 at 11:26 am
I am doinga select from tablea joining onto tableB. Alll data is retrieved correctly is it possible to get a field which would display the ownumber also along with th select. Any help on this will be greatly appreciated.
TIA
August 25, 2006 at 11:35 am
Which version of SQL Server ? SQL 2005 has ranking functions which can supply a row number.
In SQL 2000, you'd need to first select into a temporary table with an Identity column, then perform your final select out of that table.
August 25, 2006 at 11:43 am
Thanks I am using sql 2000 only and you are right i couldnt see any other way other than usinga temp tablle with an identity col.
TIA
August 25, 2006 at 12:04 pm
Why can't you simply add the counter in the application when displaying the data?
August 25, 2006 at 12:10 pm
Is that something that could be done from the back end or you are saying to have the counter at front end side? Can you please clarify. TIA
August 25, 2006 at 12:27 pm
I'm saying that when you're presenting the data like in a asp report. You can manually add that counter with a variable. Isn't this option available to you?
August 25, 2006 at 3:16 pm
SELECT IDENTITY(int, 1, 1) AS RowNum, CustomerID into #tmpA from northwind.dbo.orders
select * from #tmpA
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply