t sql conditional order by multiple columns

Solutions on MaxInterview for t sql conditional order by multiple columns by the best coders in the world

showing results for - "t sql conditional order by multiple columns"
Valerio
29 Sep 2019
1SELECT * FROM dbo.Employee
2ORDER BY 
3 CASE WHEN Gender='Male' THEN EmployeeName END Desc,
4 CASE WHEN Gender='Female' THEN Country END ASC