Results 1 to 2 of 2

Thread: Query to fetch data in matrix format

  1. #1
    Geek_Guest
    Guest

    Query to fetch data in matrix format

    Can any one tell how can we write a query which will fetch the data in matrix format..
    Question asked by visitor Sethu Murugan


  2. #2
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Query to fetch data in matrix format

    try this sample code
    u might get what u are looking for

    Code:
    SELECT job,
                           sum(decode(deptno,10,sal)) DEPT10,
                           sum(decode(deptno,20,sal)) DEPT20,
                           sum(decode(deptno,30,sal)) DEPT30,
                           sum(decode(deptno,40,sal)) DEPT40
                           FROM emp
                          GROUP BY job
                         ORDER BY job



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact