MIN and MAX functions can be used in sequenced aggregations with temporal tables, however it is important to apply them to appropriate columns. For the aircraft service example, the information in the Charge column is not a state value. Applying MIN and MAX to this column in a time dependent sequenced aggregation would give results that are easily misinterpreted or not meaningful.
However, it would be meaningful to ask for the minimum and maximum number of workers assigned to all jobs combined at any time:
SEQUENCED VALIDTIME SELECT id, min(NumWorkersAssigned) as Minworkers, max(NumWorkersAssigned) as Maxworkers FROM aircraft_service GROUP BY 1 ORDER BY VALIDTIME;
ID | Minworkers | Maxworkers | VALIDTIME |
---|---|---|---|
123 | 5 | 5 | ('11/01/04', '11/01/05') |
123 | 3 | 5 | ('11/01/05', '11/01/06') |
123 | 1 | 5 | ('11/01/06', '11/01/07') |
123 | 1 | 5 | ('11/01/07', '11/01/08') |
123 | 1 | 1 | ('11/01/08', '11/01/09') |