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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 ORDER BY

Author  Topic 

rajeshkumar77
Starting Member

46 Posts

Posted - 2002-05-02 : 00:43:30
Dear friends,

I have a strange doubt. please help me.

When i use ORDER BY in my query ...
select * from emp Order by slno;
The records will be displayed in the order of slno like this
1,2,3,4,5,6,7,....

Is there anyway to display the records like this..
.....7,6,5,4,3,2,1
If you have any idea, please help me what query should i use to display the records from top (max value) to bottom (min value).

Thanks in advance for your kind cooperation.
Looking for your reply
Yours
Rajesh

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-05-02 : 00:50:16
Hi

That's an easy one

Select * from emp Order by slno DESC


Hope that helps

Damian
Go to Top of Page

chadmat
The Chadinator

1974 Posts

Posted - 2002-05-02 : 00:50:39
What a slam dunk for my 500th Post!

select * from emp Order by slno DESC

-Chad

Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-05-02 : 00:51:38
Except you got in late

Sorry to do it to you ......

Damian
Go to Top of Page

chadmat
The Chadinator

1974 Posts

Posted - 2002-05-02 : 00:51:45
C'mon Merk!

You snipped my 500th

-Chad

Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-05-02 : 00:52:42
And sniped you noticing my sniping




Damian
Go to Top of Page

rajeshkumar77
Starting Member

46 Posts

Posted - 2002-05-02 : 01:09:44
Dear Merkin and Chad,

Thank you very much for your replies. Really I haven't exepected the fast replies and the easy solution to my doubt.

I will use ur query in my applicn, with ur references. Thanks once again for your co operation.

If you need any assistance, please contact me at getfastreply@hotmail.com.

Thank you.
Rajesh

quote:

Hi

That's an easy one

Select * from emp Order by slno DESC


Hope that helps

Damian



Go to Top of Page

Nazim
A custom title

1408 Posts

Posted - 2002-05-02 : 01:20:02
Ah, you better pay the Royalty to SQLTeam when you use it
quote:


I will use ur query in my applicn, with ur references. Thanks once again for your co operation.



What kinda Assistance , can you provide ??????

quote:

If you need any assistance, please contact me at getfastreply@hotmail.com.





--------------------------------------------------------------
Go to Top of Page
   

- Advertisement -