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.
| Author |
Topic |
|
amarflora
Starting Member
4 Posts |
Posted - 2008-12-19 : 10:44:05
|
| Is there any way to order by a particular alphabet. For example I have the following table with the entriesFA1233AA2321YH1232I want to order by "FA" first and then by AAThanks for your help! |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-12-19 : 10:48:00
|
| and where does the yh come in? by what alphabet?___________________________________________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.1 out! |
 |
|
|
amarflora
Starting Member
4 Posts |
Posted - 2008-12-19 : 10:52:01
|
| Well its just a table format. I dont mind Sorting it by 'FA' first and then regular sorting because I want to show the 'FA' values on top. Thanks. |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-12-19 : 10:59:25
|
| select ... from table... where ...order by case when yourColumn like 'FA%' then 0 else 1 end___________________________________________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.1 out! |
 |
|
|
Jai Krishna
Constraint Violating Yak Guru
333 Posts |
Posted - 2008-12-19 : 22:55:42
|
| select col from table order by case when yourColumn like 'FA%' then '0' else col endJai Krishna |
 |
|
|
|
|
|