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 |
|
Cyclonik
Posting Yak Master
114 Posts |
Posted - 2006-04-04 : 13:06:17
|
| How would I create an artificial row number in a select statement? example: select @rownum=@rownum+1, column from tableThanks,Christian |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-04-04 : 13:50:33
|
| [code]USE PubsSELECT COUNT(e1.emp_id) as [record #], e1.emp_id , e1.fname, e1.lnameFROM employee AS e1INNER JOIN employee AS e2 ON e1.emp_id >= e2.emp_idgroup by e1.emp_id , e1.fname , e1.lname order by e1.emp_id[/code]Srinika |
 |
|
|
Cyclonik
Posting Yak Master
114 Posts |
Posted - 2006-04-04 : 14:00:20
|
| THanks. This solution seems rather slow. Any more high performance way to accomplish this? |
 |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-05 : 01:49:34
|
| Where do you want to show the data?Use front end application to number the result. Just send data to client applicationMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|