nth Highest salary

Find the Nth highest salary

Solution: Common logic for all database is as...

select t.name,t.salary from employee t
  where N= (
              select count(u.salary) from
                  (select distinct salary from employee ) as u
                  where t.salary<= u.salary
       )

Comments

Popular posts from this blog

Read Images from a xlsx file using Apache POI

Read Excel using Apache POI - Exception in thread "main" org.apache.poi.poifs.filesystem.OfficeXmlFileException:

Struts 2 : Warning :No configuration found for the specified action: 'Login.action' in namespace: '/'