Home > database >  SQL in how to solve when there is a second one value, will this value is ignored when calculating
SQL in how to solve when there is a second one value, will this value is ignored when calculating

Time:10-08

There are two column data
Number. The Value
100
1.50
1.110
1.100
2.120
1.110
2.120
2.50
2.
Each value appears twice, first appeared, in front of the number is 1, the second time, in front of the number is 2.
Now I want to start from the first line by line, each time all look at the lines and to maximize the value, if the line above, the value appeared twice, then the value is failure, does not take into account when calculating the maximum the value, that is to say, finally it is concluded that the result is like this,

Number. The Value. MAX
100
1. 100.110
1. 110.110
1. 50.100
2. 110.120
1. 120.120
2. 100.50
2. 120.
Thank you master first!

CodePudding user response:

Sorting chaos, why are you the original data 1. 50 in the second line, want to run results show that the third line?
  • Related