Check out example codes for "t-sql conditional order by multiple columns". It will help you in understanding the concepts better.

Code Example 1

SELECT * FROM dbo.Employee
ORDER BY 
 CASE WHEN Gender='Male' THEN EmployeeName END Desc,
 CASE WHEN Gender='Female' THEN Country END ASC

Learn ReactJs, React Native from akashmittal.com