Results 1 to 2 of 2

Thread: SQL query....

  1. #1
    Join Date
    Jan 2004
    Posts
    153

    Unanswered: SQL query....

    The following statement gives the result as follows:

    SQL> select ename,sal,dname
    from emp e,dept d
    where e.deptno(+)=d.deptno

    ENAME SAL DNAME
    ---------- ---------- --------------
    KING 5000 ACCOUNTING
    CLARK 2450 ACCOUNTING
    MILLER 1300 ACCOUNTING
    ......... ...... .................
    JAMES 950 SALES
    WARD 1250 SALES
    OPERATIONS

    I would like to have the output as follows :

    ENAME SAL DNAME
    ---------- ---------- --------------
    KING 5000 ACCOUNTING
    CLARK 2450 ACCOUNTING
    MILLER 1300 ACCOUNTING
    ......... ...... .................
    JAMES 950 SALES
    WARD 1250 SALES
    No_EMP No_EMP OPERATIONS

    Could you please let me know the query statement?

    Regards,
    JD

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Use NVL:

    select NVL(ename,'No Emp'),NVL(sal,'No EMP'),dname
    ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •