MasterBillTo b on b.BillToCode = s.BillToCode and b.StartDate <= @asOf and @asOf < b.EndDate -- JOIN 先にも where s.StartDate <= @asOf and @asOf < s.EndDate -- 本体にも -- 削除は日付で表現する ここで気を使うのは、検索条件の漏れ 書き漏れにより、行の重複やデータの取得につながってしまう SCD Type 2(Slowly Changing Dimension Type 2) 14