SQLServer数据库Isnull()CAST()函数实例讲解
程序员文章站
2022-05-03 19:38:32
SELECT isnull(Sum(CAST(DAY0 AS DECIMAL(8,2)) ),0) as DAYSALES from SMASTOREFORECASTINFO
I...
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位小数
上一篇: asp.net MVC 发送邮件
下一篇: oracle数据库SQL查询语句练习三