GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Tech FAQs  >  SQL

 Print  |  
Question:  What is the Querry for retrieving the 2nd highest salary in a table?



March 03, 2006 22:23:38 #1
 Ed Di Database Expert  Member Since: March 2006    Total Comments: 46 

RE: What is the Querry for retrieving the 2nd highest ...
 

SELECT SALARY

FROM    EMPLOYEE

WHERE  SALARY=(SELECT MAX(SALARY)

                         FROM    EMPLOYEE

                         WHERE  SALARY <> (SELECT MAX(SALARY)

                                                      FROM    EMPLOYEE))

     

 

Back To Question