mysql> select route,route <= '69.4.176.178',route_end,route_end >= '69.4.176.178' from entries where route_type like '%ospf%' and route <= '69.4.176.178' and route_end >= '69.4.176.178'; +--------------+-------------------------+--------------+-----------------------------+ | route | route <= '69.4.176.178' | route_end | route_end >= '69.4.176.178' | +--------------+-------------------------+--------------+-----------------------------+ | 69.4.176.16 | 1 | 69.4.176.23 | 1 | | 69.4.176.176 | 1 | 69.4.176.191 | 1 | | 69.4.176.16 | 1 | 69.4.176.23 | 1 | +--------------+-------------------------+--------------+-----------------------------+ 3 rows in set (0.02 sec)