Please visit DEMANDDRAFT.SHOP for quality of products...

Ad

Search This Blog

Tuesday, October 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