Home > database > How the Oracle of the current row in three fields to compare size, choose the qualified data?
How the Oracle of the current row in three fields to compare size, choose the qualified data?
Time:10-03
Oracle has the following table: Type value1 lower upper A 0.11 0.05 0.89 A 0.23 0.11 0.99 A 0.81 0.1 0.34
0.11 0.75 0.99 B 0.34 0.05 0.89 B 0.45 0.01 0.66 B 0.01 0.05 0.72 B
0.33 0.05 0.79 C 0.22 0.21 0.79 C 0.98 0.05 1.00 C .
I want to find out value1 & gt;=the lower and value1 & lt;=upper, and carried out in accordance with the type type statistics, Results: The count type 2 A 2 B 3 C
CodePudding user response:
Select count (*) count, type the from table1 where value1 & gt;=the lower and value1 & lt;=upper group by type