Try WHERE C-D < 0

Not all databases (like Sybase) allow you to alias an expression and use it later as a reference

On Tuesday, May 15, 2012, julianne anyim wrote:
Hello people,

I have a query in the form;

SELECT A, B, (C-D) AS E ...

I need to return only values where E<0 for instance. I know i can achieve this in php, but is there a way i can achieve it at the SQL level?

I have tried:


SELECT A, B, (C-D) AS E
WHERE E<0

but i get an "ORA-00904: : invalid identifier" error. E is not recognized.

Any insights?

Thank you
Julianne