Added CASE to handle null values for nullable columns
Added CASE to handle null values for nullable columns

rlorenzo/tmlpstats,rlorenzo/tmlpstats,tmlpstats/tmlpstats,tmlpstats/tmlpstats,rlorenzo/tmlpstats,tmlpstats/tmlpstats,rlorenzo/tmlpstats,tmlpstats/tmlpstats,rlorenzo/tmlpstats