I would like to know if it is possible to combine two statements into a single one in SQLite.
The first statement is the following:
SELECT MAX(goodput_mbps), packetsize_bytes
FROM data
WHERE src = "A" AND dst = "B"
GROUP BY packetsize_bytes
which produces somthing like:
(1.065251641628522, 32)
(2.023058064838313, 64)
(3.9937457226166333, 128)
(7.13931248161879, 256)
(9.732371794078158, 384)
(12.030082350641777, 512)
(14.941748420411137, 640)
(16.768300606617814, 768)
(19.55032187231529, 1028)
(21.54109687187735, 1280)
(23.025071751003825, 1460)
(15.871752691948677, 1534)
(17.309115863006014, 1788)
(18.40483524961694, 2048)
For each entry I then run another SQL query using as parameters for the WHERE clause the first and the second entry of each record, for example for the first entry of the previous result set I would run:
SELECT MAX(median)-MIN(median) / MAX(bitrate_mbps)-MIN(bitrate_mbps), packetsize_bytes
FROM data
WHERE src = "A" and dst = "B" and packetsize_bytes = 32 and bitrate_mbps < 1.12
ORDER BY bitrate_mbps ASC
which produces something like:
(0.035000000000000225, 32)
Basically I would like to have a single query that produces something like:
(x, 32)
(x, 64)
(x, 128)
(x, 256)
(x, 384)
(x, 512)
(x, 640)
(x, 768)
(x, 1028)
(x, 1280)
(x, 1460)
(x, 1534)
(x, 1788)
(x, 2048)
Is this possible in SQLite? I know that there is the WHERE IN clause but it seem to accept a single parameter.