回答編集履歴
2
推敲
answer
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
name1=coalesce((select teamname from master where id=team.name1), team.name1)
|
6
6
|
, name2=coalesce((select teamname from master where id=team.name2), team.name2)
|
7
7
|
```
|
8
|
-
from句で指定するのは編集元なのでupdateで指定するものとは別と考えて下さい。
|
8
|
+
from句を使用する場合、from句で指定するのは編集元なのでupdateで指定するものとは別と考えて下さい。
|
9
9
|
なので、プライマリーキーを条件にする必要があり、以下では仮にそれを**Key**としています
|
10
10
|
```SQL
|
11
11
|
update team tgt set
|
1
推敲
answer
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
, name2=coalesce((select teamname from master where id=team.name2), team.name2)
|
7
7
|
```
|
8
8
|
from句で指定するのは編集元なのでupdateで指定するものとは別と考えて下さい。
|
9
|
-
なので、プライマリーキーを条件にする必要があ
|
9
|
+
なので、プライマリーキーを条件にする必要があり、以下では仮にそれを**Key**としています
|
10
10
|
```SQL
|
11
11
|
update team tgt set
|
12
12
|
name1=coalesce(a.teamname, tgt.name1)
|