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 |
itnagaraj
Yak Posting Veteran
70 Posts |
Posted - 2013-01-29 : 02:26:48
|
The data should stroed in below order.FormatId FormatDescription1 Full Proposal w/Purchase Agreement2 Short Proposal/Purchase Agreement3 Purchase Agreement4 Other5 Test data6 NABut i would need to select the data in below format.Alphabetical order First and "other" and "NA" should be at the end of the list.V.NAGARAJAN |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-01-29 : 02:48:29
|
[code]SELECT *FROM TableORDER BY CASE FormatDescription WHEN 'Other' THEN 1 WHEN 'N/A' THEN 2 ELSE 0 END ASC,FormatDescription ASC[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
itnagaraj
Yak Posting Veteran
70 Posts |
Posted - 2013-01-29 : 03:01:10
|
It will work. Thanks for your help.quote: Originally posted by visakh16
SELECT *FROM TableORDER BY CASE FormatDescription WHEN 'Other' THEN 1 WHEN 'N/A' THEN 2 ELSE 0 END ASC,FormatDescription ASC ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
V.NAGARAJAN |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-01-29 : 03:06:08
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|