3 bugfix on code I wrote before. I've press return before check for typos.
source | link

I have a table named products like this:

| product_name | start_year | end_year |
|--------------|------------|----------|
| wine         | 2001       | 2012     |
| cheese       | 1999       | 2010     |
| breadapple        | 2008       | 2015     | 

What kind of query do I have to run to have all values between start_year and end_year where product = 'apple'?

This is the desired results:

| year |
|------|
| 20072008 |
| 20082009 |
| 20092010 |
| 20102011 |
| 20112012 |
| 2013 |
| 2014 |
| 2015 |

I have a table named products like this:

| product_name | start_year | end_year |
|--------------|------------|----------|
| wine         | 2001       | 2012     |
| cheese       | 1999       | 2010     |
| bread        | 2008       | 2015     | 

What kind of query do I have to run to have all values between start_year and end_year where product = 'apple'?

This is the desired results:

| year |
|------|
| 2007 |
| 2008 |
| 2009 |
| 2010 |
| 2011 |

I have a table named products like this:

| product_name | start_year | end_year |
|--------------|------------|----------|
| wine         | 2001       | 2012     |
| cheese       | 1999       | 2010     |
| apple        | 2008       | 2015     | 

What kind of query do I have to run to have all values between start_year and end_year where product = 'apple'?

This is the desired results:

| year |
|------|
| 2008 |
| 2009 |
| 2010 |
| 2011 |
| 2012 |
| 2013 |
| 2014 |
| 2015 |
2 added 58 characters in body; edited tags
source | link

I have a table named productsproducts like this:

| product_name | start_year | end_year | |--------------|------------|----------| | wine | 2001 | 2012 | | cheese | 1999 | 2010 | | bread | 2008 | 2015 |

| product_name | start_year | end_year |
|--------------|------------|----------|
| wine         | 2001       | 2012     |
| cheese       | 1999       | 2010     |
| bread        | 2008       | 2015     | 

What kind of query do I have to run to have all values between start_yearstart_year and end_year end_year where product = 'apple'product = 'apple'?

This is the desired results:

| year | |------| | 2007 | | 2008 | | 2009 | | 2010 | | 2011 |

| year |
|------|
| 2007 |
| 2008 |
| 2009 |
| 2010 |
| 2011 |

I have a table named products like this:

| product_name | start_year | end_year | |--------------|------------|----------| | wine | 2001 | 2012 | | cheese | 1999 | 2010 | | bread | 2008 | 2015 |

What kind of query do I have to run to have all values between start_year and end_year where product = 'apple'?

This is the desired results:

| year | |------| | 2007 | | 2008 | | 2009 | | 2010 | | 2011 |

I have a table named products like this:

| product_name | start_year | end_year |
|--------------|------------|----------|
| wine         | 2001       | 2012     |
| cheese       | 1999       | 2010     |
| bread        | 2008       | 2015     | 

What kind of query do I have to run to have all values between start_year and end_year where product = 'apple'?

This is the desired results:

| year |
|------|
| 2007 |
| 2008 |
| 2009 |
| 2010 |
| 2011 |
1
source | link

Select distinct values between two values in different field

I have a table named products like this:

| product_name | start_year | end_year | |--------------|------------|----------| | wine | 2001 | 2012 | | cheese | 1999 | 2010 | | bread | 2008 | 2015 |

What kind of query do I have to run to have all values between start_year and end_year where product = 'apple'?

This is the desired results:

| year | |------| | 2007 | | 2008 | | 2009 | | 2010 | | 2011 |