Tuesday, July 1, 2014

SQL query using not equal to or not exists


SELECT [Client Name],[Outputs]
FROM
(
SELECT *,
SUM(CASE WHEN Outputs IN ('BA','Pre Start') THEN 1 ELSE 0 END) OVER (PARTITION BY [Client Name]) AS Cnt
FROM Table
)t
WHERE Cnt = 0





Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c


No comments:

Post a Comment