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 - 2002-07-03 : 08:58:41
|
| Quyen writes "How to create the order column in Select statement ?Ex : Select Name From Test1 Binh2 Lam3 Xuan4 Nam......." |
|
|
dsdeming
479 Posts |
Posted - 2002-07-03 : 09:19:47
|
| Look for IDENTITY in BOL. |
 |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2002-07-03 : 10:35:52
|
| i've a feeling that the questioner is looking for a solution whereby the recordset contains a rownumber for each record in the recordset...which SQL doesn't support directly.... |
 |
|
|
M.E.
Aged Yak Warrior
539 Posts |
Posted - 2002-07-03 : 11:01:01
|
| Quyen,What they are saying here is you can't add it in a select statement like that (unless you really like cursors and union... But thats ugly and very slow). What you want to do is add a column to your table like thiscreate table test(Test_ID int identity(1,1),Name varchar(50))Test_ID will now hold an order number (sql will input this on it's own, you don't have to. Look it up in Books Online for more information). Then your select statement becomesselect Test_ID, Name from testthis will give the results you want.-----------------------Take my advice, I dare ya |
 |
|
|
QuyenLam
Starting Member
1 Post |
Posted - 2002-07-03 : 21:05:06
|
| Hi all,But I want get records in the table follow a condition that a column order for these records?Ex : Select Name From Test where Name like '%N'1 Nam2 Ninh3 Na.....Thanks |
 |
|
|
|
|
|