Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
vass writes "Is there any possible to increment the value while do the select ? like 1 - -- --2 -- -- --3 -- -- --Regards,Vass"
Srinika
Master Smack Fu Yak Hacker
1378 Posts
Posted - 2006-08-11 : 09:03:32
U mean something like
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
Srinika
robvolk
Most Valuable Yak
15732 Posts
Posted - 2006-08-11 : 09:15:11
Oooooh, it's a cross between SQL and Morse Code! You can search SQL Team for "row number" and find a few articles on how to do it.