I need to make quite a simple request to the database. My table ( table_bla ) looks like this:

In words, the query is: Select the first nonzero value in float_val , where fiel_id 208,209,210 for this obj_id . And if it is more than 1000, but less than 2000, then in the rev_val this obj_idб where field_id 402 , put 1.
If the selected value is more than 2000 but less than 5000, then in the rev_val this obj_idб where field_id 402 , put 2.
And more than 10,000, but less than 20,000 - 4 the rest is 402 = 5