Here is one of the need to modify the SQL statement,
Select sum (t.w ork_hour - t.o utside_work_hour) AS TEST, t.d epartment_name from si_monthly_time t
Where 1=1 and to_number (tc ount_date) & gt;=to_number (to_char (to_date (? BeginTime, 'yyyy - MM),' yyyyMM '))
And to_number (tc ount_date) & lt;=to_number (to_char (to_date (? EndTime 'yyyy - MM'), 'yyyyMM'))
And t.i n_instrument_id in (select v.i n_instrument_id from in_instrument v where v.i s_to_count='0')
Group by t.d epartment_name
If
The CREATE OR REPLACE the VIEW TEST
AS
Select sum (t.w ork_hour - t.o utside_work_hour) AS TEST, t.d epartment_name from si_monthly_time t
Create such view, do not contain count_date this field,
Can't use the where a query into the field,
Turn your bosses, how to modify,
CodePudding user response:
The SUM () OVER PARTITION BY (a) whether to thisCodePudding user response: