Select (3 + 3). A, b (a + 1);
CodePudding user response:
select @ v:=(3 + 3) a, b (@ v + 1);
CodePudding user response:
The finish is a syntax errorCorrect writing:
Select (3 + 3). A, b (' a '+ 1);
Results:
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
A | b
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
6 | 1
CodePudding user response:
You say that also can't use,CodePudding user response:
With TMP as(select 3 + 3 as the from a dual)
Select a, a + 1 as b from TMP.
CodePudding user response:
A is variable, like this,SELECT (3 + 3) a, a + 1) b (@.
It is a field name,
SELECT (3 + 3), a (a + 1) b table_name;
CodePudding user response:
The set @ a=3 + 3;The set @ b=@ a + 1;
Select @ a, @ b;
CodePudding user response:
/* mysql @ inside a for what? Variable, the second field can't capture ah */