Bounding box extent
extent(box): box
WITH boxes(b) AS ( SELECT tbox 'TBOX((1, 2000-01-01),(3, 2000-01-03))' UNION SELECT tbox 'TBOX((5, 2000-01-05),(7, 2000-01-07))' UNION SELECT tbox 'TBOX((6, 2000-01-06),(8, 2000-01-08))' ) SELECT extent(b) FROM boxes; -- TBOX((1,2000-01-01 00:00:00+01),(8,2000-01-08 00:00:00+01)) WITH boxes(b) AS ( SELECT stbox 'STBOX Z((1, 1, 1),(3, 3, 3))' UNION SELECT stbox 'STBOX Z((5, 5, 5),(7, 7, 7))' UNION SELECT stbox 'STBOX Z((6, 6, 6),(8, 8, 8))' ) SELECT extent(b) FROM boxes; -- STBOX Z((1,1,1),(8,8,8))