SELECT isnull(Sum(CAST(DAY0 AS DECIMAL(8,2)) ),0) as DAYSALES from SMASTOREFORECASTINFO
Isnull(): Sum(CAST(DAY0 AS DECIMAL(8,2)) )为NULL 时候 会把0赋值给DAYSALES
CAST():CAST(DAY0 AS DECIMAL(8,2)) 将每天的DAY0 值最多8位储存,2位小数
SELECT isnull(Sum(CAST(DAY0 AS DECIMAL(8,2)) ),0) as DAYSALES from SMASTOREFORECASTINFO
Isnull(): Sum(CAST(DAY0 AS DECIMAL(8,2)) )为NULL 时候 会把0赋值给DAYSALES
CAST():CAST(DAY0 AS DECIMAL(8,2)) 将每天的DAY0 值最多8位储存,2位小数