Re: Can I do this with a view?

From: <srini_at_teldta.com>
Date: 1996/07/19
Message-ID: <31EFF402.4282_at_teldta.com>#1/1


Tom Alborough wrote:
>
> Hi,
>
> I have Table Unit_Day_Shift:
>
> Unit_ID Day_Date Shift_SN Run_Hours
> =================================================
> 123 1-Jan 1 2
> 123 1-Jan 2 4
> 123 1-jan 3 0
> 345 1-jan 1 0
> 345 1-jan 2 2
>
> Is this doable with a view?
>
> Thanks,
> TomYes . This is doable with view
create view unit_day as
select uni_id, day_date,

       sum(decode (shift_sn,1,run__hours)) shift_1_hours,
       sum(decode (shift_sn,2,run__hours)) shift_2_hours,
       sum(decode (shift_sn,3,run__hours)) shift_3_hours
 from unit_day_shift
 group by uni_id, day_date; Received on Fri Jul 19 1996 - 00:00:00 CEST

Original text of this message