Answer the question
In order to leave comments, you need to log in
Is it possible to somehow use the "alias" of a column in calculations of another column?
Hello! There is here such sql request.
SELECT
`первый`,
`что то длинное с вычислениями` AS "left_payd",
`третий` AS "price",
FROM `откуда то`
SELECT
`первый`,
`что то длинное с вычислениями` AS "left_payd",
`третий` AS "price",
`left_payd` / `price` AS "left_payd_in_percent"
FROM `откуда то`
Answer the question
In order to leave comments, you need to log in
SELECT
field1,
field2,
field1/field2 AS field3
FROM
(
SELECT
... AS field1,
... AS field2
FROM ...
) t
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question