Skip to content

Commit

Permalink
Correct syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
slb-halfspace committed Dec 3, 2024
1 parent 2fe01df commit 93541af
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 93541af

Please sign in to comment.