7 Replies Latest reply: Mar 19, 2014 2:36 AM by Veeranjaneyulu Pabbineedi RSS

    transposing rows to columns ?

    Veeranjaneyulu Pabbineedi

      HI All,

       

      I have tables like this :

      table1:

      load

      emp_id.

      comp_id,

      level_id;

       

      table2:

      load

      level_id,level_value;

       

      table3;

      load

      comp_id,

      comp_name

      comp_type;

       

      sample data:

      emp_id,comp_id,level_id

      a1,           2            ,3

      b1             3            ,2

      c1          4               ,1

      d1          5              1


      level_id,level_value

      1,1

      2,3

      3,2

       

      comp_id,comp_name,comp_type

      2,               a1            a

      3,               a2               a

      4,               a3               a

      5               b1               b

       

      where comp_names are grouped under comp_type.

       

      not i want to select like

      comp_name1 and its rating and comp_name2 and its rating .

      which should give me the employees for the selected criteria.

       

      now i want data like

      a and b as columns and the respective comp_name under those a and b columns.

       

       

       

       

      Thanks,

      Anjee