语义上是按书写的从前到后顺序匹配的。参考sql 2006标准的Part 2: Foundation (SQL/Foundation)的6.11 <case expression>:
2) Case:a) If the value of the <search condition> of some <searched when clause> in a <case specification> is True, then the value of the <case specification> is the value of the <result> of the first (leftmost) <searched when clause> whose <search condition> evaluates to True, cast as the declared type of the <case specification>.b) If no <search condition> in a <case specification> evaluates to True, then the value of the <case expression> is the value of the <result> of the explicit or implicit <else clause>, cast as the declared type of the <case specification>.当然优化器有可能可以尝试分析when的条件是否互斥,如果互斥而且无副作用的话可以任意调整顺序,不过表面上展现的语义仍然跟从前到后顺序匹配是一样的。所以从使用的角度看就只认顺序匹配就对了。