why the result of the query is in asending order
- From: bhavik <bhavik@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 18 Apr 2005 04:21:02 -0700
hi
i am facing one problem
i am having two table location and routesegment
location table having locationid as primary key.
routesegment having startlocation and endlocation and other columns.
routesegment table is
rsid rid distance
sloc eloc
---------------------------------------------------------
94 10 1.0700000431388617 20 25 1
95 10 0.15000000596046448 25 24 1
96 10 1.6400000620633364 24 27 1
97 10 0.12000000476837158 27 26 1
98 10 0.54000001028180122 26 28 1
rsid=routesegmentid
rid=routeid
sloc=startlocation
eloc=endlocation
i am firing one query which shows the locationname and locationid
query is
SELECT
distinct locationname,locationid
FROM
routesegment
,location
WHERE
(startlocation=locationid
or
endlocation=locationid)
and
routeid=@routeid(lets take 126)
(resul of query is as follows ,which is not desirable)
locationname locationid
---------------------------------------
Gallery 20
loc1 24
loc2 25
WP1 26
WP2 27
wp3 28
i want my result to be
in the following way(which is the actual order in routesegment : desirable)
locationname locationid
---------------------------------------
Gallery 20
loc2 25
loc1 24
WP2 27
WP1 26
wp3 28
why the result of the query is in asending order
is ther any solution
waiting for reply
thanks in advance
regards
Pravin
.
- Follow-Ups:
- Re: why the result of the query is in asending order
- From: Hugo Kornelis
- Re: why the result of the query is in asending order
- Prev by Date: Re: Missing Format() - Function
- Next by Date: Re: Multiple variables
- Previous by thread: msde AlaptopND sql server on save
- Next by thread: Re: why the result of the query is in asending order
- Index(es):