Hi List, I have a problem wherein I need to get the first 3 highest value in separate columns. My tables were I actually retrieve the data looks like this, this is a child table that's why the fk_id is the same, so the LIMIT clause would not be possible for the result:
fk_id bin qty1 qty2 1 3 2 6 -> 8 1 800 9 5 ->14 1 2 10 1 ->11 1 7 3 3 ->6 1 10 8 5 ->13 1 15 1 9 ->10 1 23 10 2 ->12 You will notice two qty value on the same bin, what I would like to do is add the 2 qty per bin and get the first 3 highest values like: fk_id 1st_highest_bin 1st_highest_qty 2nd_highest_bin 2nd_highest_qty 3rd_highest_bin 3rd_highest_qty 1 800 14 10 13 23 12 I did try to generate a query but only up to the highest value and was not able to get the 2nd and 3rd highest. Is this possible using only a query or needed an API to generate?? I will really appreciate your help. Thanks in advance. -- Richard Bornay ST Assembly Test Services Test Product Engineering Test Data Management Group 6824-1367