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 |
|
Srinivasan__
Starting Member
1 Post |
Posted - 2011-05-25 : 05:25:08
|
| I have table called UsersList which contains the following rowsID Name Password== ==== =========1 NoName1 NoPassword12 NoName2 NoPassword23 NoName3 NoPassword34 NoName4 NoPassword45 NoName5 NoPassword56 NoName6 NoPassword6I want to use SELECT query to display like below fashionID Name Password== ==== =========5 NoName5 NoPassword53 NoName3 NoPassword36 NoName6 NoPassword64 NoName4 NoPassword41 NoName1 NoPassword12 NoName2 NoPassword2Any help on this...Thanks in advance |
|
|
Bazalddo
Starting Member
22 Posts |
Posted - 2011-05-25 : 05:30:24
|
| Hi,One way you could do it is when you insert the rows into the table assign them an order e.g.SELECT ID, Name, Password, 1 AS OrderThen when you run the query order by the 'Order' columnThe only downside to this is that it is a bit long winded when creating the table but that is the only way I know how to do it.Hope this helpsShahbaz AhdiApps DeveloperODEON/UCI Cinema |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2011-05-25 : 11:56:18
|
| Is there a formula for how to determine the order or is it just random? |
 |
|
|
|
|
|