Here is a small change that I am about to check in that extends the
count() function:
count(self,fieldname="*")
This change in query.py as well as the corresponding funcion in
manager.py extend the count() function. In the default case the
function is unchanged. If a fieldname is supplied, then the SQL query
is changed from COUNT(*) to COUNT(columnname).
The effect is that the count now returns the number of rows where the
named column has a non-null value.
Rock
I'll buy that. (Jacob and I were also considering the count(distinct
columnname)
SQL syntax and decided not to target that since it was already easy to
combine
distinct with count(). You point out that this logic also holds for
isnull. Point taken.)
I'll rework my patch for 1435 to remove that change.
Rock