i have a table like this
+--------+------------+-----------+
| id | volume | price |
+--------+------------+-----------+
| 1 | 1.0000 | 14250.00 |
| 2 | 0.2500 | 14251.10 |
| 3 | 0.2500 | 14250.00 |
| 4 | 0.0050 | 14200.00 |
| 5 | 0.5000 | 14255.01 |
+--------+------------+-----------+
Simply if volume 1.7500, how to select like bellow by ordering(highest price)
+--------+------------+-----------+
| id | volume | price |
+--------+------------+-----------+
| 5 | 0.5000 | 14255.01 |
| 2 | 0.2500 | 14251.10 |
| 1 | 1.0000 | 14250.00 |
+--------+------------+-----------+
And if volume 1.5000 it also select the least amounts of records needed to calculate to the input volume
+--------+------------+-----------+
| id | volume | price |
+--------+------------+-----------+
| 5 | 0.5000 | 14255.01 |
| 1 | 1.0000 | 14250.00 |
+--------+------------+-----------+
some guys say i cant do this with sql