select ST.CRPGroup, MIN(ST.InitialHour), MAX(ST.InitialHour + ST.HoursShift)
from ShiftTypes ST
inner join PLMWorkPlaceShiftTypes WT on (WT.shifttype_id = ST.ID)
inner join PLMWorkPlaces WP on (WT.parent_id = WP.ID)
where WP.Hidden = 'N'
and WP.CRPPlan > 0
and WP.MachineCount > 0.000
group by
ST.CRPGroup
order by
MIN(ST.InitialHour), ST.CRPGroup
Generated by ABRA Software a.s. 27.10.2021 16:34:49