I have 2 tables MEMBEN and MEMELIG, data is as below.
i want to join two tables in such way that it does not give cartesian product but selective data on basis of datespan of Benefit eff and benefit end date, so consider for above example we take member with id = '1001',
below picture contains all details which i am looking for.
Please help on this i tried using WITH clause but not able to proceed with result.
sql sql-server tsql inner-join