Make PostgreSQL BETWEEN more dynamic base on data records

Viewed 28
select distinct 
case 
when sampleColumn between 0(needs to be dynamic) and 5(needs to be dynamic)
then 'sample'
from sampleTable

This is the data table that contains the dynamic data. column(id,value,text,order)

1 , 5 , '0-5', 0
2 , 10 , '5-10', 1

something like this. the value here in table will be put in the between sql.

0 Answers
Related