Re: NULL to 0
| From: | Andrés G. Montañez | Date: | Sun, 18 Jul 2010 02:20:20 +0000 |
| Subject: | Re: NULL to 0 | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-47265@lists.php.net to get a copy of this message | ||
SELECT
IFNULL(SUM(
my_Bible_trivia_knowledge_questions_answered.score),
0) AS total_score,
IFNULL(my_Bible_trivia_knowledge_profile.questions_answered, 0)
AS questions_answered
In these cases you must use the IFNULL function, for testing the value.
--
Andrés G. Montañez
Zend Certified Engineer
Montevideo - Uruguay