I can do that:
SELECT
1 AS one,
2 AS two,
1 + 2 AS three;
开发者_StackOverflow社区But I would like to do that:
SELECT
1 AS one,
2 AS two,
one + two AS three;
Is it possible?
You can do this:
SELECT one, two, (one+two) as three
FROM
(
SELECT
1 AS one
2 AS two
) t;
A way is this:
SELECT one, two, one + two AS 'three'
FROM (SELECT 1 as 'one', 2 as 'two') myTable
精彩评论