Need help with a complex Join statement in SQL
问题 How can you join between a table with a sparse number of dates and another table with an exhaustive number of dates such that the gaps between the sparse dates take the values of the previous sparse date? Illustrative example: PRICE table (sparse dates): date itemid price 2008-12-04 1 $1 2008-12-11 1 $3 2008-12-15 1 $7 VOLUME table (exhaustive dates): date itemid volume_amt 2008-12-04 1 12345 2008-12-05 1 23456 2008-12-08 1 34567 2008-12-09 1 ... 2008-12-10 1 2008-12-11 1 2008-12-12 1 2008-12