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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-05-01 : 12:37:57
|
| Mahesh writes "I got your email id from sqlteam.com. I have one question for u. Can you tell me, how to generate serial number in sql query (SQL Server) (like in Oracle, ROWNUM is there, which returns the rownumber. Similarly to this, does SQL server have any function, etc, which will return the row numbers? Thanks in advance, " |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-05-02 : 01:53:00
|
| Use column that has identity propertyCreate table test(i int identity(1,1),n varchar(100))Insert into test(n) select 'Test' union all select 'More tests'Select * from testIf you want to number the result set use front end application to do thatMadhivananFailing to plan is Planning to fail |
 |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-05-02 : 01:59:35
|
| In SQL 2005 there is function called ROW_Number() And if you are using SQL 2000 then refer the following linkhttp://www.sqlteam.com/item.asp?ItemID=1491If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them. |
 |
|
|
|
|
|