Q:

Fetch 2 records for each group name of element of column 1 that in column 2 have the most value

I have a table that like below.  Now i want to fetch 2 records for each group name of element of column 1 that in column 2 have the most value. For example, Fetch 85 and 75 for A, 65 and 45 for B ... 
I use oracle database.
TNX
 ----------------------
 |Column 1 | Column 2 |
 ----------------------
 |    A    |    85    |
 ----------------------
 |    A    |    75    |
 ---------------------
 |    A    |    60    |
 ---------------------
 |    A    |    50    |
 ---------------------
 |    B    |    65    |
 ---------------------
 |    B    |    45    |
 ---------------------
 |    B    |    35    |
 ---------------------
 |    B    |    25    |
 ---------------------

A:

You can use row_number() :
select t.*
from (select t.*,
             row_number() over (partition by col1 order by col2 desc) as seq 
      from table t
     ) t
where seq <= 2;

However, fetch first . . . clause also helpful :
select t.*
from table t
where t.col2 in (select t1.col2
                 from table t1
                 where t1.col1 = t.col1
                 order by t1.col2 desc
                 fetch first 2 rows only
                );

