Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Simple SQL question
I can't seem to find the answer to this question anywhere.
If I have a query such as:
SELECT x/2, y+3 FROM mytable;
Is it possible to use the calculated values x/2 and y+3 in another column? I was thinking of something like:
SELECT x/2 AS a, y+3 AS b, a + b FROM mytable;
I'm thinking more of cases where the expressions would be a lot more complex (like nested SELECTS). I have a situation where I have 2 nested selects and I want to perform a calculation on the results and use that as a third column. Is there some way to do what I want? In the example above I get an error stating that columns a and b don't exist.
Thanks. Received on Sat Dec 07 2002 - 03:49:06 CST