Pages

Men

rh

10/22/2013

How to write Case Statement in Order by Clase in SQL Server

Example :-

SELECT FirstName,LastName,DepartmentName   FROM dbo.Tbl_Employee
ORDER BY
 CASE  DepartmentName WHEN 'EDP' THEN FirstName    ELSE  LastName END;

       

No comments :

Post a Comment