ITeye博客

MySQL 程序式写法

greybeard · 2012-04-28 17:14 · mysql · 数据库 · Markdown

  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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。