From a534899449f115b2e18ba99a0c643686bba3fa42 Mon Sep 17 00:00:00 2001 From: Evanette Burrows Date: Wed, 24 Jul 2024 16:17:41 -0400 Subject: [PATCH 1/2] Align insert and select clauses --- inst/sql/sql_server/cdm_version/v531/insert_location.sql | 2 +- inst/sql/sql_server/cdm_version/v540/insert_location.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/sql/sql_server/cdm_version/v531/insert_location.sql b/inst/sql/sql_server/cdm_version/v531/insert_location.sql index e3d201d..995e79a 100644 --- a/inst/sql/sql_server/cdm_version/v531/insert_location.sql +++ b/inst/sql/sql_server/cdm_version/v531/insert_location.sql @@ -6,8 +6,8 @@ address_1, address_2, city, state, -zip, county, +zip, location_source_value ) select diff --git a/inst/sql/sql_server/cdm_version/v540/insert_location.sql b/inst/sql/sql_server/cdm_version/v540/insert_location.sql index e3d201d..995e79a 100644 --- a/inst/sql/sql_server/cdm_version/v540/insert_location.sql +++ b/inst/sql/sql_server/cdm_version/v540/insert_location.sql @@ -6,8 +6,8 @@ address_1, address_2, city, state, -zip, county, +zip, location_source_value ) select From f3a4a0acb072f4e40cb31e01a3b6ff9887d0f1c3 Mon Sep 17 00:00:00 2001 From: Evanette Burrows Date: Wed, 24 Jul 2024 16:22:59 -0400 Subject: [PATCH 2/2] Add order by for SQL server https://github.com/OHDSI/ETL-Synthea/issues/197 --- inst/sql/sql_server/cdm_version/v531/insert_location.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/sql/sql_server/cdm_version/v531/insert_location.sql b/inst/sql/sql_server/cdm_version/v531/insert_location.sql index 995e79a..764355a 100644 --- a/inst/sql/sql_server/cdm_version/v531/insert_location.sql +++ b/inst/sql/sql_server/cdm_version/v531/insert_location.sql @@ -11,7 +11,7 @@ zip, location_source_value ) select -row_number() over () as location_id, +row_number() over (order by city,state,zip) as location_id, locations.* from (select distinct