select
P_ID,
S_SES,
P_PRIOR,
P_VID,
P_DTBEGIN,
P_DTEND,
cast('00:00' as time) + (cast(P_DTEND as time) - cast(P_DTBEGIN as time)) P_DELTAT,
P_NEW
from
PRT join SES on (P_SES_ID = S_ID)
where
P_PRIOR=0
union all
select
P_ID,
S_SES,
P_PRIOR,
P_VID,
P_DTBEGIN,
P_DTEND,
cast('00:00' as time) + (cast(P_DTEND as time) - cast(P_DTBEGIN as time)) P_DELTAT,
P_NEW
from
PRT join SES on (P_SES_ID = S_ID)
where
P_PRIOR=1
|