alias in where clause
913578May 10 2013 — edited May 10 2013Hi,
This is a OCA certification question.
1. SQL> SELECT prod_name,prod_list_price,prod_list_price-(prod_list_price*.25) "DISCOUNTED_PRICE"
FROM products
WHERE discounted_price<10;
The query generates an error.
What is the reason of generating error?
A. The parenthesis should be added to enclose the entire expression
B. The double quotation marks should be removed from the column alias
C. The column alias should be replaced with the expression in the WHERE clause
D. The column alias should be put in uppercase and enclosed within double quotation marks in the WHERE clause
Answer: D
My question is how can we use alias ("DISCOUNTED_PRICE") in where clause as (WHERE "DISCOUNTED_PRICE"<10) ??
please clarify.