dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Aug 02, 2007 5:54 am Post subject: |
|
|
no function. solved using Correlated Subselect
sample queries have been provided many times.
use the search feature of this forum.
Since you did not deem it appropriate to provide any details, I am providing a solution that will work if you are using Vsn7 or above:
Code: |
SELECT SALARY, EMPNO, LASTNAME
FROM EMP E1
WHERE 4 > (SELECT COUNT(*)
FROM EMP E2
WHERE E1.SALARY < E2.SALARY)
ORDER BY 1 ASC
FETCH FIRST ROWS ONLY;
|
Change the '4' in the WHERE clause to whatever when you wish a different ?th.
again, I feel that this is a student or interview question and should not be put in this forum, but instead in the appropriate Interview forum. _________________ Dick Brenholtz
American living in Varel, Germany |
|