From 93541af0cdac38c2514ed24a27d1af804570eadd Mon Sep 17 00:00:00 2001 From: "Svend (SLB)" Date: Tue, 3 Dec 2024 15:05:11 +0100 Subject: [PATCH] Correct syntax --- .../202412021300_migrate_dh2_calculations.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/databricks/calculation_engine/package/datamigration/migration_scripts/202412021300_migrate_dh2_calculations.sql b/source/databricks/calculation_engine/package/datamigration/migration_scripts/202412021300_migrate_dh2_calculations.sql index 48383c51fa..0393289477 100644 --- a/source/databricks/calculation_engine/package/datamigration/migration_scripts/202412021300_migrate_dh2_calculations.sql +++ b/source/databricks/calculation_engine/package/datamigration/migration_scripts/202412021300_migrate_dh2_calculations.sql @@ -16,19 +16,19 @@ -- STEP 1: Delete existing rows across Wholesale's domain DELETE FROM {CATALOG_NAME}.{WHOLESALE_RESULTS_INTERNAL_DATABASE_NAME}.energy as e1 -WHERE EXISTS (SELECT c.calculation_id FROM {CATALOG_NAME}.{WHOLESALE_INTERNAL_DATABASE_NAME}.calculations c WHERE e1.calculation_id = c.calculation_id and calculation_version = 0) +WHERE EXISTS (SELECT c.calculation_id FROM {CATALOG_NAME}.{WHOLESALE_INTERNAL_DATABASE_NAME}.calculations c WHERE e1.calculation_id = c.calculation_id and c.calculation_version = 0) GO DELETE FROM {CATALOG_NAME}.{WHOLESALE_RESULTS_INTERNAL_DATABASE_NAME}.energy_per_b as e2 -WHERE EXISTS (SELECT c.calculation_id FROM {CATALOG_NAME}.{WHOLESALE_INTERNAL_DATABASE_NAME}.calculations c WHERE e2.calculation_id = c.calculation_id and calculation_version = 0) +WHERE EXISTS (SELECT c.calculation_id FROM {CATALOG_NAME}.{WHOLESALE_INTERNAL_DATABASE_NAME}.calculations c WHERE e2.calculation_id = c.calculation_id and c.calculation_version = 0) GO DELETE FROM {CATALOG_NAME}.{WHOLESALE_RESULTS_INTERNAL_DATABASE_NAME}.energy_per_es as e3 -WHERE EXISTS (SELECT c.calculation_id FROM {CATALOG_NAME}.{WHOLESALE_INTERNAL_DATABASE_NAME}.calculations c WHERE e3.calculation_id = c.calculation_id and calculation_version = 0) +WHERE EXISTS (SELECT c.calculation_id FROM {CATALOG_NAME}.{WHOLESALE_INTERNAL_DATABASE_NAME}.calculations c WHERE e3.calculation_id = c.calculation_id and c.calculation_version = 0) GO DELETE FROM {CATALOG_NAME}.{WHOLESALE_INTERNAL_DATABASE_NAME}.calculation_grid_areas as g1 -WHERE EXISTS (SELECT c.calculation_id FROM {CATALOG_NAME}.{WHOLESALE_INTERNAL_DATABASE_NAME}.calculations c WHERE g1.calculation_id = c.calculation_id and calculation_version = 0) +WHERE EXISTS (SELECT c.calculation_id FROM {CATALOG_NAME}.{WHOLESALE_INTERNAL_DATABASE_NAME}.calculations c WHERE g1.calculation_id = c.calculation_id and c.calculation_version = 0) GO -- STEP 2: Remove the DH2 calculations from the main table