Friday, April 11, 2008

find Nth highest salary of employee by procedure

[sourcecode language="sql"]
Create proc GetNthmaxsalary
@high int
set nocount on
SELECT TOP 1 emp1.salary FROM ( SELECT DISTINCT TOP @high salary FROM emp ORDER BY salary DESC) as emp1 ORDER BY emp1.salary


No comments :

Post a Comment

AJAX, asp,, and sql server security, IntemIndex, C#, Css, DataBinder.Eval, DataKeyNames, Datalist, Datapager, DataSet, DataTable, DropDownList, FindControl, gridview, JavaScript, jquery, Listview, Paging, Regex, RegularExpression, Repeater, Server side validation, Sql Server, timer, timercallback, Validation, XML, xmlnode, XPath