回答編集履歴

1

訂正

2018/07/11 06:24

投稿

ttyp03
ttyp03

スコア16998

test CHANGED
@@ -4,12 +4,34 @@
4
4
 
5
5
  SELECT kickoff AS キックオフ日時,
6
6
 
7
- (select IsNull(name, '') from countries where p.my_country_id = id) AS 国名1,
7
+ IsNull((select name from countries where p.my_country_id = id), '') AS 国名1,
8
8
 
9
- (select IsNull(name, '') from countries where p.enemy_country_id = id) AS 国名2
9
+ IsNull((select name from countries where p.enemy_country_id = id), '') AS 国名2
10
10
 
11
11
  FROM pairings p
12
12
 
13
13
  ORDER BY kickoff
14
14
 
15
15
  ```
16
+
17
+
18
+
19
+ LEFT JOIN の置き換えだったらNULLはNULLのままでいいのか。
20
+
21
+ だとするとIsNullはいらないか。
22
+
23
+
24
+
25
+ ```SQL
26
+
27
+ SELECT kickoff AS キックオフ日時,
28
+
29
+ (select name from countries where p.my_country_id = id) AS 国名1,
30
+
31
+ (select name from countries where p.enemy_country_id = id) AS 国名2
32
+
33
+ FROM pairings p
34
+
35
+ ORDER BY kickoff
36
+
37
+ ```