| Article: |
SQL Subqueries | |
| Subject: | nth subquery if the records has same salary for two or three employees | |
| Date: | 2006-02-06 04:55:06 | |
| From: | onlinestudyguide | |
|
sir, the following is the emp1 table havin empno| empname| sal|deptno 101 |balu|6000| 101101 |
||
Showing messages 1 through 1 of 1.




This takes care of the duplicate and also the null value in the salary column:
select employee_ssn,salary from employee e1 where (select count(*) from(select distinct salary from employee) e2 where nvl(e2.salary,0)>nvl(e1.salary,0))<&a;