質問編集履歴

2

修正

2020/07/16 06:25

投稿

tororon730
tororon730

スコア1

test CHANGED
File without changes
test CHANGED
@@ -54,7 +54,7 @@
54
54
 
55
55
  on TEAM.NAME1 = a.ID
56
56
 
57
- INNER JOIN tl_matchTable b
57
+ INNER JOIN MASTER b
58
58
 
59
59
  on TEAM.NAME2 = b.ID
60
60
 

1

修正

2020/07/16 06:25

投稿

tororon730
tororon730

スコア1

test CHANGED
@@ -1 +1 @@
1
- SQLSERVER INNERJOINを用いたUPDATE文において複数回INNERJOINは使えないのか
1
+ SQLSERVER INNER JOINを用いたUPDATE文において複数回INNERJOINは使えないのか
test CHANGED
@@ -2,7 +2,15 @@
2
2
 
3
3
 
4
4
 
5
+ 最初の投稿ではミスが多数あり、本当に申し訳ございません。
6
+
7
+ 修正させていただきます。
8
+
9
+
10
+
5
11
  UPDATE TEAM
12
+
13
+ ```SQL
6
14
 
7
15
  SET NAME1 = a.TEAMNAME
8
16
 
@@ -10,9 +18,11 @@
10
18
 
11
19
  INNER JOIN MASTER a
12
20
 
13
- ON TEAM.ID = a.ID
21
+ ON TEAM.NAME1 = a.ID
14
22
 
23
+ ```
15
24
 
25
+ ```SQL
16
26
 
17
27
  UPDATE TEAM
18
28
 
@@ -22,29 +32,33 @@
22
32
 
23
33
  INNER JOIN MASTER b
24
34
 
25
- ON TEAM.ID = b.ID
35
+ ON TEAM.NAME2 = b.ID
36
+
37
+ ```
38
+
39
+
26
40
 
27
41
 
28
42
 
29
43
  はそれぞれ実行できますが、
30
44
 
31
-
45
+ ```SQL
32
46
 
33
47
  UPDATE TEAM
34
48
 
35
- SET NAME1 = a.TEAMNAME
49
+ SET NAME1 = a.TEAMNAME, NAME2 = b.TEAMNAME
36
-
37
- SET NAME2 = b.TEAMNAME
38
50
 
39
51
  FROM TEAM
40
52
 
41
53
  INNER JOIN MASTER a
42
54
 
43
- ON TEAM.ID = a.ID
55
+ on TEAM.NAME1 = a.ID
44
56
 
45
- INNER JOIN MASTER b
57
+ INNER JOIN tl_matchTable b
46
58
 
47
- ON TEAM.ID = b.ID;
59
+ on TEAM.NAME2 = b.ID
60
+
61
+ ```
48
62
 
49
63
 
50
64