msg7086
2017-06-28 02:40:33 +08:00
节选自标准文档。
ANSI SQL Draft 2003 5WD-01-Framework-2003-09.pdf
6.3.3.3 Rule evaluation order
...
Where the precedence is not determined by the Formats or by parentheses, effective evaluation of expressions is generally performed from left to right. However, it is implementation-dependent whether expressions are actually evaluated left to right, particularly when operands or operators might cause conditions to be raised or if the results of the expressions can be determined without completely evaluating all parts of the expression.
说是通常可以选择从左到右进行计算,但是具体是否要从左到右计算,是由数据库软件自行决定的。如果数据库认为优先计算其他表达式可以提高计算速度,那么他可以自行选择求值顺序。