I need some clarification on the ORA-00904 error documentation. I have a column that is a case stmt, and I'm trying to use that column in the WHERE clause of my sql.
Code:
SELECT
.
.
.
CASE
WHEN YTD < YMPE THEN 100
WHEN YTD > YMPE THEN 200
ELSE 0
END AS CORRECTED_EARNINGS
.
.
.
WHERE
.
.
.
AND CORRECTED_EARNINGS > 100
End of Code
I get a 904 error in the WHERE clause stating that CORRECTED_EARNINGS is an invalid identifier.
Some help would be greatly appreicated.
Lauren McDonald
Code:
SELECT
.
.
.
CASE
WHEN YTD < YMPE THEN 100
WHEN YTD > YMPE THEN 200
ELSE 0
END AS CORRECTED_EARNINGS
.
.
.
WHERE
.
.
.
AND CORRECTED_EARNINGS > 100
End of Code
I get a 904 error in the WHERE clause stating that CORRECTED_EARNINGS is an invalid identifier.
Some help would be greatly appreicated.
Lauren McDonald