des

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

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

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached