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.
Author |
Topic |
SQL2000User
Starting Member
13 Posts |
Posted - 2006-11-17 : 10:00:56
|
Hi, I know how to select row number , but getting the problem to put this data as one column of the table. If there is anyway to do it without temp tableThe way I select the row number is :SELECT COUNT(*) AS [Row Number], c.CustomerID, c.CustName FROM Customer c, Customer dWHERE d.CustomerID <= c.CustomerIDGROUP BY c.customerID, c.CustName ORDER BY c.customerIDThanks Flora |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-11-17 : 10:15:04
|
in sql 2005 you have the row_number() function. look it's use in BOL.it's better to store your result in temp table with identity and select from that, than doing a self join on the table.numbering should be done in front end though.Go with the flow & have fun! Else fight the flow blog thingie: http://weblogs.sqlteam.com/mladenp |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-11-18 : 05:00:49
|
>>numbering should be done in front end though.I agree with youFlora, where do you want to show data?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|