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)
 more than 1 order

Author  Topic 

darkmooink
Starting Member

5 Posts

Posted - 2006-07-03 : 10:39:32
how can i set a select statement is sorted by one thing and then by another thing ect

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-07-03 : 10:41:12

Something like

Order by case when col='One thing' then 1 when col='some thing' then 2 else 3 end

or post some sample data and the result you want

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

darkmooink
Starting Member

5 Posts

Posted - 2006-07-03 : 10:54:17
what it is, i have a dance steps tabel
id|dance id|step no| step discription|tag|restart|
1|1|1|somekind of step|0|0|
2|1|0|another step|1|0|
3|1|2|a diffrent step|0|0|

and i want them done so that tag is sorted first then step no so it lookes like this

1|1|1|somekind of step|0|0|
3|1|2|a diffrent step|0|0|
2|1|0|another step|1|0|
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-07-03 : 10:57:42
[code]select *
from table
order by tag, step_no[/code]


KH

Go to Top of Page

darkmooink
Starting Member

5 Posts

Posted - 2006-07-03 : 11:16:20
thanks works a treet
Go to Top of Page
   

- Advertisement -