I am working with a table that uses year ranges for some of the data that I need to select a year record that is between these ranges.
| id | Make | Model | Year |
|----------------|------------|------------ |
| 1 | Chevrolet | Camaro | 2008 |
| 2 | Chevrolet | Camaro | 2009 - 2014 |
| 3 | Dodge | Avenger | 2010 - 2015 |
| 4 | Dodge | Challenger | 2008 - 2016 |
| 5 | Ford | Escape | 2013 |
| 6 | Ford | Mustang | 2004 - 2012 |
| 7 | Ford | Mustang | 2015 |
For example, I want to be able to select all cars from 2012 .
This should return: 2 , 3 , 4, and 6 , as shown in the example table below.
source
share