SQLTeam.com | Weblogs | Forums

How do calulate sum of an array in SQL?



In excel there is a simple formula to calculate the number of items in an array. See the attached image. How can a column Q be calculated using SQL?


I think we will need more than just a screen shot of Excel. What is the relationship between the highlighted columns.

SELECT Sum(CASE WHEN [condition check] THEN 1 ELSE 0 END)
FROM SourceObject;