Loading ...
Sorry, an error occurred while loading the content.

1862How to form pivot table

Expand Messages
  • pengbsam
    Jan 15, 2006
      I am kind of new at it. Only been working with SQl for couple of
      month. and I have a weired questions! I have a results view such as
      below

      type Qty station expenses
      ------------ ------ ---------------------- -----------
      business 0002 station1 18722
      business 0002 station2 9564
      business 0002 station3 24278
      business 0002 station4 375
      business1 0003 station1 19566
      business1 0003 station2 NULL
      business1 0003 station3 12066
      business1 0003 station4 12875

      but actually I need to turn into format such as

      type Qty station expenses
      ------------ ------ ---------------------- -----------
      business 0002 station1 18722
      station2 9564
      station3 24278
      station4 375
      business1 0003 station1 19566
      station2 NULL
      station3 12066
      station4 12875

      Because if I don't then who ever going to use the query gonna
      suspect that they quantity is 8 and 12 pcs where it's actually 2pcs
      3 pcs, respectively! Could somebody help me out? I really
      appreciated it! Thank you!
    • Show all 7 messages in this topic