stephen99999 (1/11/2012)
Have not tested this, but :
SELECT COUNT(DISTINCT datakey) OVER(Partition by datakey) AS Uniquedatakey,
COUNT(DISTINCT CASE WHEN landline<>'' THEN landline END) OVER(Partition by datakey) AS Uniquelandline,
COUNT(DISTINCT CASE WHEN mobile<>'' THEN mobile END) OVER(Partition by datakey) AS Uniquemobile,
COUNT(DISTINCT CASE WHEN email<>'' THEN email END)OVER(Partition by datakey) AS Uniqueemail
FROM test
Incorrect syntax near 'distinct'