Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2010
    Posts
    1

    Unanswered: Using Group funtion to make records as columns

    i have query which i am not able to solve...if any1 can help....i have given query below.

    create a query that will display the number of employees and ,of the total,the number of employees hired in 1995,1996,1997 and 1998.create appropriate column headings.

    output shud come like this:

    TOTAL 1995 1996 1997 1998
    20 1 2 2 3


    total ,1995,1996,1997,1998 are columns name
    and 20,1,2,2,3 are respective results........usging group function

  2. #2
    Join Date
    Mar 2010
    Location
    Vienna, Austria
    Posts
    149
    go to Tom Kytes Site at
    Ask Tom Home
    and search for "PIVOTING".
    You'll find every information you need for your homework ...
    "There is always an easy solution to every problem - neat, plausible, and wrong."
    -- H.L. Mencken

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    oracle 11G has pivoting build in. See the following as a good example

    pivot and unpivot queries in 11g
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  4. #4
    Join Date
    Mar 2010
    Location
    Vienna, Austria
    Posts
    149
    beilstwh,

    yup, shame on me.
    Completely forgot (rarely ever need it ...)
    "There is always an easy solution to every problem - neat, plausible, and wrong."
    -- H.L. Mencken

Posting Permissions

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