Converting between clause to joins [duplicate]
问题 This question already has answers here : How to use indexes for a query filtering BETWEEN two columns (2 answers) Closed 5 years ago . Need a generic sql query for joins that can run on mysql, postgres and other major DBs I have a table named autumn4.ip , I have three columns: id,start,end (all ints). How do I make a join so that I make use of BUT not by BETWEEN but by JOINS. like pseudo: select * FROM autumn.ip WHERE :number-constant >= start ORDER BY start DESC LIMIT 1; + select * FROM