Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

alias in where clause

913578May 10 2013 — edited May 10 2013
Hi,

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.
This post has been answered by Suri on May 10 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 7 2013
Added on May 10 2013
2 comments
1,403 views