Pages - Menu
(Move to ...)
Home
About Us
Contact Us
▼
Friday, 11 April 2008
find Nth highest salary of employee by procedure
[sourcecode language="sql"]
Create proc GetNthmaxsalary
(
@high int
)
as
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
go
}
[/sourcecode]
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment