1. IF
if (condition, result1, result2)
IF(expr1 is not null, expr1, expr2) 等价于 ifnull(expr1, expr2)
ifnull()效率胜过if()
2. Case
case
when day(MaxDate)<=10 then 1
when day(MaxDate)<=20 then 2
else 3
end
if (condition, result1, result2)
IF(expr1 is not null, expr1, expr2) 等价于 ifnull(expr1, expr2)
ifnull()效率胜过if()
2. Case
case
when day(MaxDate)<=10 then 1
when day(MaxDate)<=20 then 2
else 3
end
1万+

被折叠的 条评论
为什么被折叠?



