Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2013
    Posts
    1

    Unanswered: print output using concatination & joins

    7369 is working in department 20 and his manager is FORD.

    I am trying to display above format using oracle 10g scott/tiger schema EMP table.

    i have tried with this query , but am unable display the exact ouput

    select empno ||' is working in department '|| deptno ||' and his manager is '||
    (select distinct b.ename
    from emp a,emp b
    where b.empno=a.mgr) from emp

    any modifications !!....

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    we don't know what output you expect.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    Quote Originally Posted by strikerv View Post
    [COLOR="DarkRed"]. . . E t c . . .
    any modifications !!....
    Try this:
    Code:
    SELECT empno ||' is working in department '|| deptno || ' and his manager is ' ||
           (SELECT DISTINCT b.ename
              FROM emp b
             WHERE b.empno = a.mgr)
      FROM emp a
    /
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

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