Order by desc on AVG(value) => NULL values in first
Hi,
My query is :
SELECT AVG(sucre) AS sucre, AVG(qualite) AS qualite, AVG(gout) AS gout, parfum, marque, count(sucre) AS nb_eval, tabacs.id
FROM tabacs
LEFT OUTER JOIN tabacs_notes ON tabacs.id=tabacs_notes.tabac
GROUP BY tabac, tabacs.id
ORDER BY sucre DESC
LIMIT 00, 10
According to mysql documentation, NULL values of "sucre", "qualite" and "gout" must be in last with this query :
"When using ORDER BY, NULL values are presented first, or last if you specify DESC to sort in descending order. Exception: In MySQL 4.0.2 through 4.0.10, NULL values sort first regardless of sort order. "
However NULL values are in first.
I'm using mysql 3.23.58.
What is the problem ? Is it possible to transform NULL values to 0 ?
Thanks !
Bye,
Alexis.