プログラマーとプログラミングに熱心な人々のための質問と回答
WITH temp as ( SELECT 'A' as master , 1 Col UNION SELECT 'A' , 3 UNION SELECT 'B' , 1 UNION SELECT 'B' , 2 UNION SELECT 'C' , 1 UNION SELECT NULL , 1 UNION SELECT NULL , 2 ) SELECT master, count(Col) over (partition by master) FROM temp