[thelist] SQL Question - 'Contingent Columns'

Luther, Ron Ron.Luther at COMPAQ.com
Tue Apr 16 13:16:01 CDT 2002


Thanks!

I will give it a whirl!

RonL.

-----Original Message-----
From: rudy [mailto:r937 at interlog.com]

    select p.PartNumber
          , sum(p.Field_2 * r.mult2)
          , sum(p.Field_3 * r.mult3)
          , sum(p.Field_4 * r.mult4)
       from ProductShipments p
          , ( select Region
                   , case when Column = 'Field_2'
                          then 1 else 0 end as mult2
                   , case when Column = 'Field_3'
                          then 1 else 0 end as mult3
                   , case when Column = 'Field_4'
                          then 1 else 0 end as mult4
                from UpdateStatus
               where Timeperiod = sysdate -1 )  r
      where p.Region = r.Region
   group by p.PartNumber




More information about the thelist mailing list