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!

A good way to avoid refering same table twice

Orcl ApexNov 15 2017 — edited Nov 15 2017

Hi All,

I have a query as

SELECT * FROM emp

WHERE sal >= (SELECT MAX(sal) FROM emp WHERE deptno = :p_dept);

/

Standard oracle scott or HR schema emp table can be used for my example. I would like to know which is good way to avoid using same table twice in my example.

Thanks.

This post has been answered by Frank Kulash on Nov 15 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 13 2017
Added on Nov 15 2017
15 comments
2,614 views