回答編集履歴
1
訂正
answer
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
**GROUP BY hoge**となっていますので、hogeのパターン数分の行になります。
|
2
2
|
全体で纏めたいなら**GROUP BY**は不要です。
|
3
3
|
```SQL
|
4
|
-
SELECT Max(case when hoge=4 then hoge end) as hoge4
|
4
|
+
SELECT Max(case when hoge='4' then hoge end) as hoge4
|
5
|
-
, Max(case when hoge=8 then hoge end) as hoge8
|
5
|
+
, Max(case when hoge='8' then hoge end) as hoge8
|
6
|
-
, Max(case when hoge=6 then hoge end) as hoge6
|
6
|
+
, Max(case when hoge='6' then hoge end) as hoge6
|
7
7
|
FROM abc
|
8
8
|
WHERE hoge IN('4','6','8')
|
9
9
|
```
|