Mysql – Join tables on varying condition for each row
So I have two tables: CREATE TABLE table1 (`PRIMARY_DT` date, `CUST_ID` int) ; INSERT INTO table1 (`PRIMARY_DT`, `CUST_ID`) VALUES ('2012-03-02', 878 ), ('2012-07-02', 456 ), ('2012-09-02', 789 ) ; CREATE TABLE table2 (`dt` date, `CUST_ID` int, `value` int) ; INSERT…