Order By in SQL Server with Condition or Clause

When you order by column in table in SQL Server but with the clause here is the example :

Suppose we have StateCity table.


 
 
 
Now we want to in a order that State NY is first and Else in Alphabetic Order here is the Query :
 
 

Select * from StateCity

Order By Case When [State]  = 'NY' Then '1'

              When [State]  = 'NJ' Then '2'

                       Else [State]  END ASC
 
Result:
 
 
 
Suppose you want to Order By Particular State and Particular City here is the example of the Query :
 


Select * from StateCity
Order By Case
                       When [State]  = 'NY' Then '1'
                       When [State]  = 'NJ' Then '2'
         
                                Else [State]  END ASC,
                       Case
                       When [City] = 'New York' Then '1'
                       When [City] = 'Atlanta' Then '1'
                       When [City] = 'Parsippany' Then '1'
 
                                 Else [City] END ASC
 
 

 Result: