in reply to DBI and selecting aggregate columns with no results

This is re: postgreSQL, but I think it applies to most databases...

"It should be noted that except for count, these functions return a null value when no rows are selected. In particular, sum of no rows returns null, not zero as one might expect. The function coalesce may be used to substitute zero for null when necessary".


So while your first select returns no rows, your aggregation returns the minimum of a null set, which is null.

That's my theory anyways :)
--------------
It's sad that a family can be torn apart by such a such a simple thing as a pack of wild dogs
  • Comment on Re: DBI and selecting aggregate columns with no results