I need to use a SQL statement that is bound to a Gridview & needs to be something like
SELECT * from Table Sum(Column1) AS S00, (S00/CONSTANT) AS C01 or
SELECT * from Table Sum(Column1) AS S00, Sum(Column1) / CONSTANT AS C01
CONSTANT will be a value passed to the query as a session variable.
i.e the 2nd column of the Gridview is calculated from the result of 1st calculation.
What will be the best way to achieve this?
You’ll need to repeat the expression, or use a subquery e.g.