Print whole line with highest value from one column

Hi, I have a little issue right now.
I have a file with 4 columns

test0000002,10030010330,c_,218
test0000002,10030010330,d_,202
test0000002,10030010330,b_,193
test0000002,10030010020,c_,178
test0000002,10030010020,b_,170
test0000002,10030010330,a_,166
test0000002,10030010020,a_,151
test0000002,10030010020,d_,150
test0000002,10030070050,c_,119
test0000002,10030070050,b_,99
test0000002,10030070050,d_,79
test0000002,10030070050,a_,56
test0000002,10030010390,c_,55
test0000002,10030010390,b_,44
test0000002,10030010380,d_,41
test0000002,10030010380,a_,37
test0000002,10030010390,d_,35
test0000002,10030010380,c_,33
test0000002,10030010390,a_,31
test0000002,10030010320,c_,30
test0000002,10030010320,b_,27
test0000002,10030010380,b_,26
test0000002,10030010320,a_,23
test0000002,10030010320,d_,22
test0000002,10030010010,a_,6

and I want the highest value from 4th column sorted from 2nd column.

test0000002,10030010330,c_,218 
test0000002,10030010020,c_,178 
test0000002,10030010330,a_,166 
test0000002,10030010020,a_,151 
test0000002,10030070050,c_,119 
test0000002,10030010390,c_,55 
test0000002,10030010380,d_,41 
test0000002,10030010320,c_,30 
test0000002,10030010390,a_,31 
test0000002,10030010380,c_,33 
test0000002,10030010390,d_,35 
test0000002,10030010320,a_,23 
test0000002,10030010380,b_,26 
test0000002,10030010010,a_,6

The input file is shown as already sorted using 4th column but the output is not quite sorted. hmm...

If the input is not sorted, try something like:

sort -r -n -k4 -t"," inputfile | awk -F, '$2 != b ;  {b=$2}'

If input already sorted then just:

awk -F, '$2 != b ;  {b=$2}' inputfile

Sorry my friend I have put the wrong output.
The correct in this example are 7 lines

test0000002,10030010330,c_,218 
test0000002,10030010020,c_,178 
test0000002,10030070050,c_,119 
test0000002,10030010390,c_,55 
test0000002,10030010380,d_,41 
test0000002,10030010320,c_,30 
test0000002,10030010010,a_,6
awk -F, '!a[$2]++' inputfile