Skip to content Skip to sidebar Skip to footer

Sql Server Query To Find Chi-square Values (not Working)

I am trying to find the Chi-Square test from my following SQL Server Query on the sample data: SELECT sessionnumber, sessioncount, timespent, expected, dev, dev*dev/expected as

Solution 1:

In your sample data, cnt is NULL, so the results are also NULL. You can replace these NULL values with a default value (1 for example, I don't know what is the context) using ISNULL, like

SELECT sessionnumber, SUM(ISNULL(cnt, 1)) as cnt FROM clusters GROUP BY sessionnumber

Post a Comment for "Sql Server Query To Find Chi-square Values (not Working)"