I have a view like this:
col_1 col_2 my_date
----- ----- -------
1 5 2011
2 6 2014
3 7 2012
4 8 2011
And a table like this:
date_1 date_2 the_value
------ ------ ---------
2010 2012 v1
2013 2015 v2
I want something like the Excel VLOOKUP function that find the value (the_value
) which my_date
is between date_1
and date_2
, so I can have a result like this:
col_1 col_2 my_date the_value
----- ----- ------- ---------
1 5 2011 v1
2 6 2014 v2
3 7 2012 v1
4 8 2011 v1
The type of date columns are DATE
. These are sample data for simplicity.