|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| 11/02/2009 at 08:38PM PST, ID: 24866136 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: |
create or replace procedure sp_logontime_examption is
declare
cursor lan;
cursor per_month;
number max_diff;
number avg_diff;
begin
update logontime_dailytemp t set examption_part = 'N', examption_full = 'N';
open lan for select t.zonename, t.slr from logontime_ipmap t;
for lan1 in lan loop
update logontime_dailytemp t set (examption_full) = ('Y')
where exists
( select 1 from logontime_dailytemp s where s.task_id=t.task_id and (abs(t.task_start_datetime-s.task_start_datetime)/ 1.15740740740741E-5 <= 30*60 )
and t.diff > lan1.slr and s.diff<= lan1.slr and examption_full='N' and rownum<=1
) and t.task_id=lan1.zonename;
-- select avg(diff) into
open per_month for select distinct to_char(task_start_datetime, 'YYYY-MM') from logontime_dailytemp;
max_diff := 99999;
for month1 in per_month loop
select ad into avg_diff, md into max_diff from
(select avg(diff) ad, max(diff) md
from logontime_dailytemp
where to_char(task_start_datetime, 'YYYY-MM')=month1 and examption_part='N' and diff<max_diff and task_id = lan1.zonename group by 1);
end loop;
end loop;
update logontime_dailytemp t set examption_full = 'Y'
where exists
( select 1 from logontime_dailytemp s where s.task_id=t.task_id and (abs(t.task_start_datetime-s.task_start_datetime)/ 1.15740740740741E-5 <= 30*60 )
and t.diff > 30 and s.diff<= 30 and rownum<=1
) and t.task_id='KAH';
end sp_logontime_examption;
|
Advertisement