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
 Transact-SQL (2000)
 Order by..

Author  Topic 

jung1975
Aged Yak Warrior

503 Posts

Posted - 2005-03-02 : 12:22:23
I have a table looks like:

Changes
High to He
High to High
Low to He
Low to High
Low to Low


I want to change the order, so the output should looks like:

High to He
High to High
Low to He
Low to Low
Low to High

How can I do this?





nr
SQLTeam MVY

12543 Posts

Posted - 2005-03-02 : 12:30:11
How are you ordering the output at the moment?
Use the same order by but add at the front

case when changes = 'Low to High' then 1 else 0 end ,

If you don't have an order by clause then the question is meaningless as the order can change at any time.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -