Scope of a hint

The scope of a hint is at the statement block level. This would be either for the entire statement in a simple query or for the parent statement or subquery level in a complex query.

The following is a hint that applies only to a subquery:

SELECT ename, empno, job FROM emp
WHERE deptno IN
    (SELECT /*+ RULE */ deptno FROM dept WHERE dname = 'SALES');

Get Oracle Database Administration: The Essential Refe now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.