错误写法:
sum(case when log_score>=300 and log_score<350 then 1 else 0 )as 300-350
正确写法:
sum(case when log_score>=300 and log_score<350 then 1 else 0 end )as `300-350`
注意:最后使用的是 飘号
本文纠正了一种常见的SQL语法错误,即在使用Case When语句时未正确结束的情况。展示了正确的Case When...End语法,并强调了使用飘号(`)的重要性。
错误写法:
sum(case when log_score>=300 and log_score<350 then 1 else 0 )as 300-350
正确写法:
sum(case when log_score>=300 and log_score<350 then 1 else 0 end )as `300-350`
注意:最后使用的是 飘号

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