Say I have the following data
Name Value =============== Small 10 Medium 100 Large 1000
Imagine that these represent the
WITH ranges_table AS (SELECT LEVEL * 100 AS range_value FROM DUAL CONNECT BY LEVEL <= 20) SELECT MIN (range_value) FROM ranges_table WHERE range_value >= 5 OR range_value = (SELECT MAX (range_value) FROM ranges_table)