Я пытаюсь обновить конкретный competition
, используя JOIN
. Структура tables
выглядит следующим образом:
страна
id | name | iso
5 Brazil BR
1012 * Конкурс *:
id | country_id | name |
1 5 Serie A
2 5 Serie B
3 5 Serie C
competition_seasons
id | competition_id | name | update_at
1 1 2019 2019-01-15 00:00:00
2 1 2018 2019-01-15 00:00:00
3 1 2017 2019-01-15 00:00:00
4 2 2019 2019-01-15 00:00:00
5 2 2018 2019-01-15 00:00:00
6 2 2017 2019-01-15 00:00:00
7 3 2019 2019-01-15 00:00:00
8 3 2018 2019-01-15 00:00:00
9 3 2017 2019-01-15 00:00:00
Цель установлена update_at
на competition_seasons
до null
. Поэтому я написал этот запрос:
UPDATE country n
JOIN competition c ON n.id = c.country_id
JOIN competition_seasons s ON c.id = s.competition_id
SET s.update_at = NULL
WHERE n.name = "Brazil"
проблема в том, что запрос ничего не обновляет. Что я не так сделал?