回答編集履歴
1
訂正
answer
CHANGED
@@ -1,8 +1,19 @@
|
|
1
1
|
こういう感じ?
|
2
2
|
```SQL
|
3
3
|
SELECT kickoff AS キックオフ日時,
|
4
|
-
(select
|
4
|
+
IsNull((select name from countries where p.my_country_id = id), '') AS 国名1,
|
5
|
-
(select
|
5
|
+
IsNull((select name from countries where p.enemy_country_id = id), '') AS 国名2
|
6
6
|
FROM pairings p
|
7
7
|
ORDER BY kickoff
|
8
|
+
```
|
9
|
+
|
10
|
+
LEFT JOIN の置き換えだったらNULLはNULLのままでいいのか。
|
11
|
+
だとするとIsNullはいらないか。
|
12
|
+
|
13
|
+
```SQL
|
14
|
+
SELECT kickoff AS キックオフ日時,
|
15
|
+
(select name from countries where p.my_country_id = id) AS 国名1,
|
16
|
+
(select name from countries where p.enemy_country_id = id) AS 国名2
|
17
|
+
FROM pairings p
|
18
|
+
ORDER BY kickoff
|
8
19
|
```
|