From 8f65e0f87f56643efcf0a027b09f5d22b1ad75c6 Mon Sep 17 00:00:00 2001 From: y-ono-r <95060536+y-ono-r@users.noreply.github.com> Date: Mon, 25 Jul 2022 15:07:41 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=E2=91=A1-2=E5=86=85=E9=83=A8=E7=B5=90?= =?UTF-8?q?=E5=90=88=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=97Where=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rds_mysql/stored_procedure/crm_history.sql | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rds_mysql/stored_procedure/crm_history.sql b/rds_mysql/stored_procedure/crm_history.sql index b60e2681..366cde70 100644 --- a/rds_mysql/stored_procedure/crm_history.sql +++ b/rds_mysql/stored_procedure/crm_history.sql @@ -70,15 +70,13 @@ BEGIN -- ②-2 「②-1」で取得した全件に更新処理を行う SET @update_end_datetime = ' UPDATE $$target_table$$ tt - LEFT JOIN $$target_table$$_make_history_tmp mht + JOIN $$target_table$$_make_history_tmp mht ON tt.id = mht.id AND tt.start_datetime = mht.min_start_datetime SET end_datetime = mht.max_start_datetime - INTERVAL 1 SECOND , upd_user = CURRENT_USER() , upd_date = CURRENT_TIMESTAMP() - 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);