|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm confident that this is a really easy function that everyone except me knows!
Using SQL Server 2000 I have the following Query: Code:
SELECT DISTINCT Busno FROM Route Which returns all the buses in the table i.e.: BusNo 34 89 234 etc What i need is an number to be returned along with that value i.e: Number BusNo 1 65 2 89 3 x56 This number doesnt actually mean anything, its just i need to output a temporary index number along with the busno, so I can populate a dropdown list. As I said its bound to be something simple, so please let me know! Cheers Last edited by sayzey : March 21st, 2005 at 12:27 PM. Reason: typo |
|
#2
|
|||
|
|||
|
Hey, managed to get a workaround so that i can get on with my application, however its not the tidiest way of doing it so if anyone has a "propper" way please do let me know.
Ive simply used the following and it works because there is only one instance of each result returned because SELECT DISTINCT is used. Code:
SELECT DISTINCT BusNo As BusIndex, BusNo FROM Route |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > An easy one for you all! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|