There is a 5000 EMP in company.how we find out the 5th
highest getting salary employee outof 5000 employes........

Answers were Sorted based on User's Feedback

There is a 5000 EMP in company.how we find out the 5th highest getting salary employee outof 5000 ..

select max(sal) from emp a where 5=(select count(distinct sal)
from emp b where a.sal<=b.sal);

 Is This Answer Correct ? 13 Yes 3 No

There is a 5000 EMP in company.how we find out the 5th highest getting salary employee outof 5000 ..

select * from emp A where 4 = (select count(*) from emp B
where A.sal<B.sal)

 Is This Answer Correct ? 6 Yes 2 No

There is a 5000 EMP in company.how we find out the 5th highest getting salary employee outof 5000 ..

SELECT * FROM T999 WHERE SAL<(SELECT MAX(SAL) FROM T999
WHERE SAL<(SELECT MAX(SAL) FROM T999 WHERE SAL<(SELECT
MAX(SAL) FROM T999 WHERE SAL<(SELECT MAX(SAL) FROM T999))));

 Is This Answer Correct ? 5 Yes 2 No

There is a 5000 EMP in company.how we find out the 5th highest getting salary employee outof 5000 ..

select max(salary) from staff where salary not in(select
salary from staff order by salary desc fetch first 4 rows
only)

 Is This Answer Correct ? 3 Yes 0 No

There is a 5000 EMP in company.how we find out the 5th highest getting salary employee outof 5000 ..

SELECT * FROM STAFF AA
WHERE 5 = (SELECT COUNT (SALARY) FROM STAFF WHERE SALARY
<= AA.SALARY );

 Is This Answer Correct ? 3 Yes 1 No

There is a 5000 EMP in company.how we find out the 5th highest getting salary employee outof 5000 ..

 Is This Answer Correct ? 0 Yes 0 No

There is a 5000 EMP in company.how we find out the 5th highest getting salary employee outof 5000 ..

SELECT SAL FROM EMP A
WHERE 5 = (SELECT COUNT(*) FROM EMP B
WHERE B.SAL >= A.SAL)

 Is This Answer Correct ? 0 Yes 0 No

There is a 5000 EMP in company.how we find out the 5th highest getting salary employee outof 5000 ..

SELECT MAX(SALARY) FROM EMP WHERE SALARY <
(SELECT MAX(SALARY) FROM EMP WHERE SALARY <
(SELECT MAX(SALARY) FROM EMP WHERE SALARY <
(SELECT MAX(SALARY) FROM EMP WHERE SALARY <
(SELECT MAX(SALARY) FROM EMP WHERE SALARY ))))

 Is This Answer Correct ? 0 Yes 1 No

There is a 5000 EMP in company.how we find out the 5th highest getting salary employee outof 5000 ..

try this one....

select * from emp where emp_Id = (select emp_Id from emp
order by sal)
and count(*) < 6;

 Is This Answer Correct ? 0 Yes 5 No

There is a 5000 EMP in company.how we find out the 5th highest getting salary employee outof 5000 ..

SELECT MAX(salary)
FROM employees
WHERE salary
NOT IN (SELECT TOP 4 salary FROM employees ORDER BY salary
DESC)

 Is This Answer Correct ? 1 Yes 7 No

More DB2 Interview Questions

What happens to a cursor after a commit?

what is static sql? what is dynamic sql? Give me details

What is host variable?

Why db2 is called db2?

What is filter factor?

Can All Users Have The Privilege To Use The SQL Statement Select (DML)?

What is a DB2 bind?

we can code COPY DCLGEN or INCLUDE DCLGEN, At which stage of the precompilation , dclgen get expanded if we write 1) copy 2) include one question about dclgen.. Is it mandatory to use declare table in dclgen.. I think no...but it will be used by the precompiler to validate the table name,column name etc.., can one clear my doubt ..is it necessary to include declare table or not?

how to unload different table data into different gdg files/ vsam files.

What is the SQL Communications Area and what are some of its key fields?

wht r the requirements for writing a cobol-db2 pgm ?

Categories