Is there a way to union or collect any number of layer geometries with Spatialite (or another spatial database)? Two is simple enough, but more than that becomes convoluted. For example, if all I want is all the geometries of four layers, I need to do:
SELECT ST_Collect(ST_Collect(tbl1.geom, tbl2.geom), ST_Collect(tbl3.geom, tbl4.geom)) FROM tbl1, tbl2, tbl3, tbl4
Is there a function or approach which would allow for something like ST_Collect(tbl1, tbl2, tbl3, tbl4)?