Assume a DB table with values
[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
Note: this pattern is not necessary (the sorted order and values from 1-30).
so using a query I can get values between 10-20 and so on.
But here I want to know how I can get values from different ranges. i.e:
- one random value from range 0-5
- one value form range 6-10
- one value from range 11-15
- one value from range 16-20
... so on.
So the output of the query will looks like:
[2,7,14,16,23,29,...]
or
[1,6,11,18,22,26,...]
Is there any way I can achieve this.