refactor:EXISTSの中身のSELECT句をIDのみに変更

This commit is contained in:
y-ono-r 2022-08-02 16:19:32 +09:00 committed by shimoda.m@nds-tyo.co.jp
parent 7447d54323
commit fa1c2b7f83

View File

@ -28,7 +28,7 @@ BEGIN
tt.end_datetime = "9999-12-31 00:00:00"
AND NOT EXISTS (
SELECT
*
tt.id
FROM
$$target_table_all$$ tta
WHERE
@ -37,8 +37,8 @@ BEGIN
)
';
SET @update_end_datetime = REPLACE(@update_end_datetime, "$$target_table$$", target_table);
SET @update_end_datetime = REPLACE(@update_end_datetime, "$$target_table_all$$", target_table_all);
SET @update_end_datetime = REPLACE(@update_end_datetime, "$$target_column$$", target_column);
SET @update_end_datetime = REPLACE(@update_end_datetime, "$$target_table_all$$", target_table_all);
SET @update_end_datetime = REPLACE(@update_end_datetime, "$$target_column$$", target_column);
PREPARE update_end_datetime_stmt from @update_end_datetime;
EXECUTE update_end_datetime_stmt;