From d165cf20ba8a84f6152eadd9d442d2a656342b11 Mon Sep 17 00:00:00 2001 From: y-ono-r <95060536+y-ono-r@users.noreply.github.com> Date: Fri, 15 Jul 2022 14:23:49 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E2=91=A1-2=E3=81=AE=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E3=83=9F=E3=82=B9=E4=BF=AE=E6=AD=A3?= 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 caeb09c0..7c183714 100644 --- a/rds_mysql/stored_procedure/crm_history.sql +++ b/rds_mysql/stored_procedure/crm_history.sql @@ -17,7 +17,7 @@ BEGIN EXECUTE make_history_tmp_create_stmt; -- ②-2 「②-1」で取得した全件に更新処理を行う - SET @update_end_datetime = 'UPDATE @@target_table tt LEFT JOIN make_history_tmp mht ON tt.id = mht.id AND tt.start_datetime = mht.min_start_datetime SET start_datetime = mht.max_start_datetime - INTERVAL 1 SECOND WHERE mht.id IS NULL'; + SET @update_end_datetime = 'UPDATE @@target_table tt LEFT JOIN make_history_tmp mht ON tt.id = mht.id AND tt.start_datetime = mht.min_start_datetime SET start_datetime = mht.max_start_datetime - INTERVAL 1 SECOND WHERE mht.id IS NOT NULL'; SET @update_end_datetime = REPLACE(@update_end_datetime, "@@target_table", target_table); SET @update_end_datetime = REPLACE(@update_end_datetime, "@@target_column", target_column); PREPARE update_end_datetime_stmt from @update_end_datetime;