I want out put like this

I have emp(ename,empno,deoptno,hiredate,job), dept (deptno, dname, loc) table without any relation ship
where can I retrieve data from tables foth? (I mean that there is no constraint key foregin between them)
If I can I how?

You can join the tables as you wish. You need not CF to do this:

SQL> select  d.dname,
  2          d.loc,
  3          e.ename
  4    from  emp e,
  5          dept d
  6    where e.deptno = d.deptno
  7    order by d.dname,
  8             e.ename
  9  /

DNAME          LOC           ENAME
-------------- ------------- ----------
ACCOUNTING     NEW YORK      CLARK
ACCOUNTING     NEW YORK      KING
ACCOUNTING     NEW YORK      MILLER
RESEARCH       DALLAS        ADAMS
RESEARCH       DALLAS        FORD
RESEARCH       DALLAS        JONES
RESEARCH       DALLAS        SCOTT
RESEARCH       DALLAS        SMITH
SALES          CHICAGO       ALLEN
SALES          CHICAGO       BLAKE
SALES          CHICAGO       JAMES

DNAME          LOC           ENAME
-------------- ------------- ----------
SALES          CHICAGO       MARTIN
SALES          CHICAGO       TURNER
SALES          CHICAGO       WARD

14 rows selected.

SQL> 

SY.

Tags: Database

Similar Questions

Maybe you are looking for