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!

I can use a subquery alias in ORDER BY but not in a WHERE clause, why?

862493May 17 2011 — edited May 17 2011
Hello everybody,

this is my first post in the forum and I'm a pl/sql beginner. Thank you for any advice an please excuse my bad english.

SELECT 'TEST', (SELECT 50 FROM DUAL) COUNT_SUM
FROM DUAL
WHERE COUNT_SUM > 50

Why can I not use COUNT_SUM in the WHERE clause? How should I do this? If I use COUNT_NUM in ORDER BY it works, but I need such a statement in such many situations. Please help me to find a solution for this or to explain me why it doesn't work

I started with pl/sql for some weeks ago and I'm not able to find an answer to this problem.

Thank you

Marius
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 14 2011
Added on May 17 2011
5 comments
5,466 views