10 Replies Latest reply: Dec 20, 2013 6:23 AM by BluShadow RSS

    Transposing rows to columns -dynamically

    97f8c995-885c-4a58-a3b8-99467978e70a

      I have a requirement of dynamically transposing rows to columns
      where the column headers need to be values from another table(joined)

      I have two tables Department and Job

      Desc:

      Dept
      ____________________________
      Dept_No  JobId      Salary
      2             J1       10000
      2             J2       20000
      3             J1       15000
      3             J2       30000
      3             J3       45000

       

      Job
      _________________________
      JobId      JobName
      1            Junior
      2            Senior
      3            Management

       

      What I require is the following output:
      __________________________________________________
      Dept_no       Junior      Senior      Management
      2                  10000      20000
      3                  15000      30000      45000