Oracle: select distinct name from tablename where salary = (select sum(salary)/count(*) as x from tablename where rownum = 5 group by x order by x);
-guoyifan(ooo);
2002-2-18(#372435@0)
select * from employee where salary= (
select top 1 salary from employee
where salary not in (select distinct top 4 salary from employee order by salary )
order by salary )
almost correct
-interview(intervieweree);
2002-2-18{182}(#372542@0)
the answer is
select * from employee where salary=
(
select max(salary) from employee
where salary not in
(
select top 4 salary from employee order by salary desc)
)
)
Yes. I was too careless and missed "desc" in my statement, which returned the 5th lowest salary instead.:)
-yangn(Raymond);
2002-2-18(#372591@0)