Slide 26
Slide 26 text
スロークエリの現場
REPLACE INTO hoge(id, name)
SELECT id, name
FROM foo AS f
INNER JOIN bar AS b ON f.event_id = b.id
WHERE f.id in (
SELECT max(event_id)
FROM f
WHERE canceled_at IS NULL
GROP BY event_id, sheet_id
);
REPLACE 構文はMySQLの独自構文