diff --git a/tools/cms_extract/create_ssd.sql b/tools/cms_extract/create_ssd.sql index 2fce018a..ee179a10 100644 --- a/tools/cms_extract/create_ssd.sql +++ b/tools/cms_extract/create_ssd.sql @@ -1763,7 +1763,7 @@ SELECT FROM Child_Social.FACT_CARE_EPISODES AS fce JOIN - Child_Social.FACT_CLA AS fc ON fce.FACT_CARE_EPISODES_ID = fc.fact_cla_id + Child_Social.FACT_CLA AS fc ON fce.fact_cla_id = fc.FACT_CLA_ID -- Removed 24/12/23 --JOIN diff --git a/tools/cms_extract/create_ssd_tmp_tables.sql b/tools/cms_extract/create_ssd_tmp_tables.sql index a1f94f09..a223f3d8 100644 --- a/tools/cms_extract/create_ssd_tmp_tables.sql +++ b/tools/cms_extract/create_ssd_tmp_tables.sql @@ -1825,8 +1825,7 @@ SELECT FROM Child_Social.FACT_CARE_EPISODES AS fce JOIN - Child_Social.FACT_CLA AS fc ON fce.FACT_CARE_EPISODES_ID = fc.fact_cla_id - + Child_Social.FACT_CLA AS fc ON fce.fact_cla_id = fc.FACT_CLA_ID -- Create index(es) CREATE NONCLUSTERED INDEX idx_clae_cla_worker_id ON #ssd_cla_episodes (clae_cla_worker_id);