Find out the 3rd highest salary?
Answers were Sorted based on User's Feedback
Answer / durgashivashankar
select min(sal) from (Select rownum,sal FROM emp> Order
by sal desc)
where rownum<=3
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nikhilesh roy
WITH
CTE as
(select emp_id,salary,rn=row_number() over (order by salary desc) from emp_table )
select * from CTE where rn=3;
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / virendra
select ename, salary from emp where salary=(select top 1
salary from (select distinct top 3 salary from emp order
by salary desc) a order by salary)
| Is This Answer Correct ? | 7 Yes | 8 No |
Answer / ajay kumar
SELECT DISTINCT SAL FROM EMP WHERE SAL = (SELECT DISTINCT
SAL FROM EMP X WHERE &N= (SELECT COUNT(DISTINCT SAL) FROM
EMP Y WHERE Y.SAL>X.SAL))
/
AFTER RUNNING THE QUERY PUT THE VALUE OF N
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / sachin saini
select min(salary) from table_name where salary in(select
top 3 salary from table_name order by salary desc )
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / abhijt shinde
select MIN(salary) from Employees
where salary IN
(Select Top 3 salary from Employees order by salary desc)
Select Top 1 salary from Employees where salary
Not IN(select Top 1 salary from Employees order by salary Desc)
order by salary Desc
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / arindam
select min(sal) from
(
select sal from
(
select distinct sal from emp order by sal desc
)
where rownum<=3
)
where rownum <4
| Is This Answer Correct ? | 5 Yes | 7 No |
Answer / srikanth
select * from (select e.*,rank() over(order by salary desc
nulls last) sal_rnk from employee e)where sal_rnk=3;
| Is This Answer Correct ? | 3 Yes | 5 No |
Answer / vishal beri
Select ename from emp e where 2=(select count(distinct(Sal))
from emp where sal>e.sal)
| Is This Answer Correct ? | 3 Yes | 5 No |
Answer / suneel
select level,max(sal)from af where level=3 connect by prior
sal>sal group by level;
| Is This Answer Correct ? | 8 Yes | 11 No |
What type of join is sql join?
Explain sql data types?
What is Difference Between Unique and Primary Key Constraints?
What is exit statement?
What is the size of partition table?
What is the order of sql select?
table name :Tab fields name 1.trx_no (pk) 2.trx_date 3.account code (7 char) 4.account type (1 char) 5.amt Tab contains account code day wise debit and credit transaction , account type fiels can have 2 value D for debit and c for Credit . write a query to display the account code wise total debit and credit bal for the month of april 2004. write a query to display account code wise new amt credit for the april 2004
write sub query for eliminating duplicate rows using analytical function?
What are some predefined exceptions in pl/sql?
I have a CURSOR then why we need BULK COLLECT again?
can we call a procedure into another procedure?If yes means how you can pass the perameters for the two procedures?
what is the difference between binary_integer and pls_integer
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)