3 Replies Latest reply: Aug 1, 2013 11:57 PM by Billy~Verreynne RSS

    transpose in Oracle - Help needed

    865889

      Hi,

       

      I need your expertise in understand how transpose works in oracle with real example.Please find original data and expected data below.

       

      Query

      --------

       

      select SFB_FILENAME,SFB_FILETMG_DATE,SFB_FILETMG_TIME,SFB_EOD_ODATE from SFB_FILETMG;

       

      Original Data

      -------------------

       

      SFB_FILENAMESFB_FILETMG_DATESFB_FILETMG_TIMESFB_EOD_ODATE
      IND_AM_339AM23-Jul-20132:5022-Jul-2013
      IND_AM_335AM23-Jul-20132:5022-Jul-2013
      IND_AM_342AM23-Jul-20132:5022-Jul-2013
      IND_AM_224AM23-Jul-20132:5022-Jul-2013
      IND_AM_338AM23-Jul-20132:5122-Jul-2013
      IND_AM_168AM23-Jul-20132:5122-Jul-2013
      IND_AM_336AM23-Jul-20132:5122-Jul-2013
      IND_AM_335AM24-Jul-20133:5123-Jul-2013
      IND_AM_338AM24-Jul-20133:5223-Jul-2013
      IND_AM_336AM24-Jul-20133:5223-Jul-2013
      IND_AM_342AM24-Jul-20133:5223-Jul-2013
      IND_AM_168AM24-Jul-20133:5323-Jul-2013
      IND_AM_224AM24-Jul-20133:5323-Jul-2013
      IND_AM_339AM24-Jul-20133:5323-Jul-2013

       

       

      Expected Data

      ---------------------

       

      22-Jul-2013SFB_FILETMG_DATESFB_FILETMG_TIME23-Jul-2013SFB_FILETMG_DATESFB_FILETMG_TIME
      IND_AM_339AM23-Jul-20132:50IND_AM_335AM24-Jul-20133:51
      IND_AM_335AM23-Jul-20132:50IND_AM_338AM24-Jul-20133:52
      IND_AM_342AM23-Jul-20132:50IND_AM_336AM24-Jul-20133:52
      IND_AM_224AM23-Jul-20132:50IND_AM_342AM24-Jul-20133:52
      IND_AM_338AM23-Jul-20132:51IND_AM_168AM24-Jul-20133:53
      IND_AM_168AM23-Jul-20132:51IND_AM_224AM24-Jul-20133:53
      IND_AM_336AM23-Jul-20132:51IND_AM_339AM24-Jul-20133:53

       

       

      Thanks