Query:
SELECT Count(id) AS Taken FROM ClassGuests WHERE id=5
Returns 1 record, value 0

Query:
SELECT Sum(nGuests) AS Taken FROM ClassGuests WHERE id=5
Returns 1 record, value '' (nothing)

And
Query:
SELECT Count(id)+Sum(nGuests) AS Taken FROM ClassGuests WHERE id=5
Returns 1 record, value '' (nothing)

I expected to be 0, but it's not. And because of that I need to convert this through code. Is that anyway to force Sum() to return 0 if nothing found?

Thanks.
Daniel

---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to