View previous topic :: View next topic
|
Author |
Message |
arindambanerjee
New User
Joined: 30 Jun 2007 Posts: 39 Location: India
|
|
|
|
Hi All,
Can you please suggest if the below SQL query will extract the details of the employee with 2nd highest salary from EMP table:
Select * from EMP where sal=(
(select sal from EMP having sal=max(sal) fetch first 2 rows only ordered by descending)
) fetch first 1 row only ordered by ascending;;; |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
suggest you run it in spufi or qmf. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
And you saw some reason to re-post this? Your original was moved to Homework from this part of the forum as it is a standard" homework assignment.
Post a question only once. . .
This dulicate is locked. . .
d |
|
Back to top |
|
|
|