Returns the length of a linear geometry. Calculates the total length of a LineString or MultiLineString in its associated spatial reference units.
ST_LENGTH(ls)Returns as a double-precision number the length of the LineString value ls in its associated spatial reference.
This page is licensed: CC BY-SA / Gnu FDL
SET @ls = 'LineString(1 1,2 2,3 3)';
SELECT ST_LENGTH(ST_GeomFromText(@ls));
+---------------------------------+
| ST_LENGTH(ST_GeomFromText(@ls)) |
+---------------------------------+
| 2.82842712474619 |
+---------------------------------+