0

I have a table with below data.

table name: t_keyword_count

f_id       f_keyword      f_count      f_dominant
==================================================
101        C++              2               0
101        Java             4               0
101        PHP              6               0
101        Python           5               0
101        Ruby             9               0
102        ruby             4               0
102        java             6               0
102        php              9               0
102        C++              7               0
102        Jquery           2               0

Like that


My Requirment is: I need update f_dominant status as 1 where I want top 3 f_count values with respect to f_id . i.e I want this result set

 101  ruby     9  1
 101  php      6  1
 101  python   5  1
 101  JAVA     4  0
 101  c++      2  0
 102  php      9  1
 102  c++      7  1
 102  jAVA     6  1
 102  RUBY     4  0
 102  JQUERY   2  0
4

2 に答える 2