5
« เมื่อ: มีนาคม 07, 2014, 11:31:30 AM »
select s.hn, s.vstdate, s.vsttime, s.service3 as sendpt2screen, s.service4 as startscreen ,
s.service11 as send2doctor, s.service5 as startexam,s.service12 as finishexam,
sec_to_time(time_to_sec(service4)-time_to_sec(service3)) as waitforscreen,
sec_to_time(time_to_sec(service11)-time_to_sec(service4)) as timetoscreen,
sec_to_time(time_to_sec(service5)-time_to_sec(service11)) as waitforexamine,
sec_to_time(time_to_sec(service12)-time_to_sec(service5)) as timetoexamine,
sec_to_time(time_to_sec(service12)-time_to_sec(service3)) as timefromvsttime2finishexam,
sec_to_time(time_to_sec(service12)-time_to_sec(service3)) as timefromvsttime2finishexam2
from service_time s,ovst o
where s.vn = o.vn and s.vstdate between '2014-03-04' and '2014-03-04'
and s.service3 is not null and s.service4 is not null and
s.service5 is not null and s.service11 is not null and s.service12 is not null and
s.service3 >= '06:00:00' and s.service12 <='16:30:30' and
s.service11>=s.service4 and s.service5>=s.service11 and s.service12>=s.service5
and o.main_dep = "010"
อยากทราบความหมายของคำด้านล่างนี้คะ ว่า แปลว่าอะไรคะ
sec_to_time(time_to_sec(service4)-time_to_sec(service3)) as waitforscreen,
sec_to_time(time_to_sec(service11)-time_to_sec(service4)) as timetoscreen,
sec_to_time(time_to_sec(service5)-time_to_sec(service11)) as waitforexamine,
sec_to_time(time_to_sec(service12)-time_to_sec(service5)) as timetoexamine,
sec_to_time(time_to_sec(service12)-time_to_sec(service3)) as timefromvsttime2finishexam,
sec_to_time(time_to_sec(service12)-time_to_sec(service3)) as timefromvsttime2finishexam2