回答編集履歴
1
調整
answer
CHANGED
@@ -3,6 +3,6 @@
|
|
3
3
|
from テーブル
|
4
4
|
group by 項目A
|
5
5
|
having sum(case 項目B when '赤' then 1 else 0 end)>0
|
6
|
-
and sum(case 項目B when '青' then 1 else 0 end)=0
|
6
|
+
and sum(case 項目B when '青' then 1 when '黄' then 1 else 0 end)=0
|
7
|
-
and sum(case 項目B when '黄' then 1 else 0 end)=0
|
8
|
-
```
|
7
|
+
```
|
8
|
+
※ちょっと効率化
|