发布于 2014-07-15 09:56:54
复杂的查询。最后一行会有结果。
SELECT
@id := id,
@geometry := Envelope(if(isNull(@geometry), `line`, GeometryCollection( `line` , geomFromText(AsText(@geometry))))),
AsText(@geometry)
FROM `table_line`
JOIN (SELECT @id :=0, @geometry := NULL) `tmp`
WHERE id > @id
ORDER BY id ASC使用这个答案
geomFromText(AsText(@geometry)) --这是必要的,因为GeometryCollection不适用于直接变量。
但是它很复杂,不要在生产中使用。
https://stackoverflow.com/questions/24732008
复制相似问题