This gist is a way of collecting cool, more unusual MySQL query techniques and tips and tricks.
use this to convert column values to more useful defaults if they are null. can be used in formulas, order by etc.
in this example, using ifnull()
avoids sums using columns that have null
values ending up as null