I tried executing the query provided by Thanooz and verified it. The Query worked but took very long time compared to my query.
I also happened to come across the same question in one of the interviews I appeared.
Definitely I couldn't answer properly, but had come half way thru' and the interviewer was keen on getting a 'single' second highest value and not the sequence in desc order. The Query is some what simple also. I've tested this properly.
Here it goes:
SELECT EMPSAL FROM EMPTABLE
WHERE EMPSAL <
(SELECT MAX(EMPSAL) FROM EMPTABLE)
ORDER BY EMPSAL DESC
FETCH FIRST ROW ONLY
Explanation of the Query:
The Inner Query will return the Max value for Empsalary and the Outer Query will provide 'any' value less than the Max value in Descending order. So in order to limit it to one value that's the second highest, Use Fetch first row only.
Can any one tell me how to set a break point in the middle of the perform
Eg perform i varying from 1 by 1 untill i>1000
I want top see the value of i =152.
I dnt want to press 152 times f9 and the value of i152
depends on the previous occurence.Do we hae any option for this
Joined: 31 May 2006 Posts: 200 Location: Netherlands
First one(B) is unconditional break point and second one is conditional break point which can be applied by keying in WHEN in the command line and supplying the variable name and the value for which you want to break.