I have two tables like below.
empid | Datefrom | Dateto | salary |
123 | 1/1/2010 | 12/31/2010 | 2300 |
123 | 1/1/2011 | 12/31/2013 | 2400 |
123 | 1/1/2014 | 12/31/9999 | 2500 |
second table
empid | Datefrom | Dateto | cc |
123 | 1/1/2010 | 12/31/2011 | c1 |
123 | 1/1/2012 | 12/31/9999 | c2 |
I need to join above two tables such that the below table should be the output:
empid | Datefrom | Dateto | cc | salary |
123 | 1/1/2010 | 12/31/2010 | c1 | 2300 |
123 | 1/1/2011 | 12/31/2011 | c1 | 2400 |
123 | 1/1/2012 | 12/31/2013 | c2 | 2400 |
123 | 1/1/2014 | 12/31/9999 | c2 | 2500 |
Can anyone give hint how to write scripted CV to generate the o/p table above?