Re: Can I do this with a view?

From: Hema Krishnamoorthy <hema_at_teldta.com>
Date: 1996/07/19
Message-ID: <31EFF475.7C56_at_teldta.com>#1/1


Tom Alborough wrote:
> I need Table Unit_Day:
> Unit_ID Day_Date Shift_1_Hours Shift_2_Hours Shift_3_Hours
> =====================================================================
> 123 1-Jan 2 4 0
> 345 1-Jan ...
> Is this doable with a view?
>
> Thanks,
> Tom

Hi,

This is possible. Try this query. This might be an answer to your question.

create view unit_day as
select unit_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 unit_id, day_date;

Hema. Received on Fri Jul 19 1996 - 00:00:00 CEST

Original text of this message