From 7b5821e38462c3d6f3704793a92dee088d5f30be Mon Sep 17 00:00:00 2001 From: y-ono-r <95060536+y-ono-r@users.noreply.github.com> Date: Mon, 1 Aug 2022 20:02:29 +0900 Subject: [PATCH] =?UTF-8?q?fix:=E4=B8=80=E6=99=82=E3=83=86=E3=83=BC?= =?UTF-8?q?=E3=83=96=E3=83=AB=E4=BD=9C=E6=88=90=E6=99=82=E3=81=AE=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rds_mysql/stored_procedure/crm_history.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rds_mysql/stored_procedure/crm_history.sql b/rds_mysql/stored_procedure/crm_history.sql index 3247da51..caeb09c0 100644 --- a/rds_mysql/stored_procedure/crm_history.sql +++ b/rds_mysql/stored_procedure/crm_history.sql @@ -10,7 +10,7 @@ BEGIN EXECUTE new_history_save_stmt; -- ②-1 Salesforce側で更新されたデータを検出用一時テーブルの作成 - SET @make_history_tmp_create = 'CREATE TEMPORARY TABLE make_history_tmp SELECT id, MIN(@@target_column) AS min_start_datetime, MAX(start_datetime) AS max_start_datetime FROM @@target_table WHERE end_datetime = "9999-12-31 00:00:00" GROUP BY id'; + SET @make_history_tmp_create = 'CREATE TEMPORARY TABLE make_history_tmp SELECT id, MIN(@@target_column) AS min_start_datetime, MAX(start_datetime) AS max_start_datetime FROM @@target_table WHERE end_datetime = "9999-12-31 00:00:00" GROUP BY id HAVING count(id) = 2'; SET @make_history_tmp_create = REPLACE(@make_history_tmp_create, "@@target_table", target_table); SET @make_history_tmp_create = REPLACE(@make_history_tmp_create, "@@target_column", target_column); PREPARE make_history_tmp_create_stmt from @make_history_tmp_create;