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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 sort table descending without orderby

Author  Topic 

arorarahul.0688
Posting Yak Master

125 Posts

Posted - 2008-06-24 : 03:57:10
can any one help me to sort a table on the basis of one colomn without using ORDER BY Desc.

Rahul Arora
07 Batch
NCCE Israna,


######################
IMPOSSIBLE = I+M+POSSIBLE

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-06-24 : 04:01:28
quote:
Originally posted by arorarahul.0688

can any one help me to sort a table on the basis of one colomn without using ORDER BY Desc.

Rahul Arora
07 Batch
NCCE Israna,


######################
IMPOSSIBLE = I+M+POSSIBLE




What's the reason of not using ORDER BY DESC ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-24 : 04:02:09
Didnt understand what you mean by sort without using Order by. CAn you explain?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-06-24 : 04:06:21
Interview or homework?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-06-24 : 04:07:06
Even with a clustered index on the table, you are not guaranteed to return the records in the same order.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2008-06-24 : 04:48:01
Probably a homework question I guess...and the real answer is that it's impossible, even though the answer you're looking for is most likely that you need to add a clustered index on that column. As Peso said adding a clustered index does not guarantee the order of records when you're selecting from that table allthough it's usually ordered correctly.

- Lumbago
Go to Top of Page

arorarahul.0688
Posting Yak Master

125 Posts

Posted - 2008-06-24 : 07:56:08
quote:
Originally posted by Peso

Interview or homework?



E 12°55'05.25"
N 56°04'39.16"



No interview not even homework. but thanx for your considerations.
thanx to those also, who considered you exactly.

Rahul Arora
07 Batch
NCCE Israna,


######################
IMPOSSIBLE = I+M+POSSIBLE
Go to Top of Page
   

- Advertisement -