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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Partitioned Outer Joins

jeneeshApr 2 2009 — edited Apr 2 2009
Hi All,

Felling strange on the below results. DB version 10.2.0.1.0
SQL> select e.ename,d.deptno,e.deptno
  2  from emp e left outer join dept d partition by (d.deptno)
  3  on (e.deptno= d.deptno);

ENAME          DEPTNO     DEPTNO
---------- ---------- ----------
CLARK              10         10
KING               10         10
MILLER             10         10
JONES              20         20
FORD               20         20
ADAMS              20         20
SMITH              20         20
SCOTT              20         20
WARD               30         30
TURNER             30         30
ALLEN              30         30
JAMES              30         30
BLAKE              30         30
MARTIN             30         30
CLARK              20         10
KING               20         10
MILLER             20         10
JONES              20         20
FORD               20         20
ADAMS              20         20
SMITH              20         20
SCOTT              20         20
WARD               30         30
TURNER             30         30
ALLEN              30         30
JAMES              30         30
BLAKE              30         30
MARTIN             30         30

28 rows selected.

SQL> select e.ename,d.deptno,e.deptno
  2  from emp e left outer join dept d partition by (d.deptno)
  3  on (e.deptno= d.deptno)
  4  order by 1;

ENAME          DEPTNO     DEPTNO
---------- ---------- ----------
ADAMS              20         20
ALLEN              30         30
BLAKE              30         30
CLARK              10         10
FORD               20         20
JAMES              30         30
JONES              20         20
KING               10         10
MARTIN             30         30
MILLER             10         10
SCOTT              20         20
SMITH              20         20
TURNER             30         30
WARD               30         30

14 rows selected.
No meaning in the qury I know. But the output when the order by clause is added is strange, atleast for me..

And how the PARTITION BY clause works exactly?

Regrards,
Jeneesh
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2009
Added on Apr 2 2009
5 comments
2,073 views