Msbi Knowledge sharing blog

I would like to share my knowledge and open to recieve knowledge from others.

Thursday, 8 November 2012

How to find the nth highest salary with out using top clause or subquery?


SELECT *
FROM EmployeeRecord e1
WHERE (2-1) = (
SELECT COUNT(DISTINCT(e2.Salery))
FROM EmployeeRecord e2
WHERE e2.Salery > e1.Salery)
Posted by Unknown at 10:42
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2013 (14)
    • ►  July (3)
    • ►  June (1)
    • ►  May (1)
    • ►  March (2)
    • ►  February (2)
    • ►  January (5)
  • ▼  2012 (58)
    • ►  December (20)
    • ▼  November (18)
      • how to copy data from one table to another in sql?
      • Functions in sql server function is like a stored...
      • How to copy particular records into another table
      • How to get specific records from a table in sql?
      • Rankin functions in sql server
      • How to get the record of highest saleried Employee...
      • Common Table expression in Sql server
      • How to find the nth highest salary with out using ...
      • How to get the table creation date?
      • How to find the top 6 salary from emp table?
      • How to find a transaction has effeced?
      • How to transfer money from one account to another ...
      • SQL SERVER – Stored Procedure and Transactions
      • STORED PROCEDURES
      • Cursors in sql server
      • Cursors in sql server?
      • Indexes in sql server
      • Rownumber in sql server
    • ►  October (20)

About Me

Unknown
View my complete profile
Ethereal theme. Powered by Blogger.