我想知道SELECT
语句中表达式的执行顺序是否总是从从左到右发生。
SET @a := 0;
SELECT
@a AS first,
@a := @a + 1 AS second,
@a := @a + 1 AS third,
@a := @a + 1 AS fourth,
@a := @a + 1 AS fifth,
@a := @a + 1 AS sixth;
是否可以保证上述查询始终会生成以下输出?
first second third fourth fifth sixth
0 1 2 3 4 5
答案 0 :(得分:3)
答案 1 :(得分:0)
是的,无论如何都没有执行顺序的配置,所以你总是得到这样的输出。