问题
I am trying to use the StDev function and am getting blank results. I am using it as...
SELECT StDev(fldMean) FROM myTable
Where fldMean contains a value of 2.3 and should evaluate to 0 but instead I am simply getting an empty result. I can't seem to understand how expressions are to be used in the function, Microsoft's manual really didn't help.
回答1:
SELECT StDev(fldMean) FROM myTable
will return Null
if [myTable] has only one row because the Standard Deviation cannot be computed from a single observation. You will need at least two rows in that table before you can receive a meaningful result. If you want to force the Null
value to zero you can use
SELECT Nz(StDev(fldMean), 0) FROM myTable
来源:https://stackoverflow.com/questions/20937087/stdev-function-returns-null-when-table-contains-only-one-row