DBMS
Programming and Technical
Programming
Technical
how to print 3rd highest salary in tha salary table?
Read Solution (Total 7)
-
- select max(salary) from salary_tb where not In(select max(salary) from salary_tb where not In(select max(salary from salary_tb )))
- 8 years agoHelpfull: Yes(2) No(0)
- Select Top 1 salary
From(
select distinct top 3 salary
From Table_Name
Order By salary Desc)
As temp
Order By salary
- 8 years agoHelpfull: Yes(1) No(2)
- sort the table according to salary column in descending order usng nested query return third highest salary
- 7 years agoHelpfull: Yes(1) No(0)
- select salary from table_name order by salary DESC limit 2,1
- 7 years agoHelpfull: Yes(1) No(0)
- SELECT name, salary
FROM #Employee e1
WHERE 3-1 = (SELECT COUNT(DISTINCT salary) FROM #Employee e2
WHERE e2.salary > e1.salary) - 5 years agoHelpfull: Yes(1) No(0)
- It can be done in 2 ways:
1) SELECT MAX(SAL) FROM SALARY WHERE NOT SAL = (SELECT MAX(SAL) FROM SALARY WHERE NOT SAL = (SELECT MAX(SAL) FROM SALARY))
2) SELECT MIN(SAL) FROM (SELECT TOP 3 * FROM SALARY ORDER BY SAL DESC)temp; - 6 years agoHelpfull: Yes(0) No(0)
- select sal from emp x where 3=(select distinct(sal) from emp y where y.sal>=x.sal);
- 5 years agoHelpfull: Yes(0) No(0)
DBMS Other Question