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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Increment Value

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-08-11 : 09:00:01
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 Pubs
SELECT COUNT(e1.emp_id) as [record #], e1.emp_id , e1.fname, e1.lname
FROM employee AS e1
INNER JOIN employee AS e2 ON e1.emp_id >= e2.emp_id
group by e1.emp_id , e1.fname , e1.lname
order by e1.emp_id


Srinika
Go to Top of Page

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.
Go to Top of Page
   

- Advertisement -