#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    1
    Rep Power
    0

    Displaying rows into columns


    I have table having below records.

    empno ename deptno

    101 a 10
    102 b 20
    103 c 10
    104 d 20
    105 e 30

    Normal Output

    deptno count(*)
    -----------------
    10 2
    20 2
    30 1

    I want to display like this(rows into columns)
    --------------------------------------------------------

    Required Output
    -------------
    10 20 30

    2 2 1
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2006
    Location
    Carlsbad, CA
    Posts
    2,055
    Rep Power
    383
    http://www.oracle-base.com/articles/11g/pivot-and-unpivot-operators-11gr1.php

    Clive

IMN logo majestic logo threadwatch logo seochat tools logo