top of page
CerebroSQL

MySQL: 

ST_SYMDIFFERENCE

ST_SymDifference(g1, g2)

Returns a geometry that represents the point set symmetric difference
of the geometry values g1 and g2, which is defined as:

g1 symdifference g2 := (g1 union g2) difference (g1 intersection g2)

Or, in function call notation:

ST_SymDifference(g1, g2) = ST_Difference(ST_Union(g1, g2), ST_Intersection(g1, g2))

ST_SymDifference() handles its arguments as described in the
introduction to this section.

URL: https://dev.mysql.com/doc/refman/8.0/en/spatial-operator-functions.html

Example

mysql> SET @g1 = Point(1,1), @g2 = Point(2,2);
mysql> SELECT ST_AsText(ST_SymDifference(@g1, @g2));
+---------------------------------------+
| ST_AsText(ST_SymDifference(@g1, @g2)) |
+---------------------------------------+
| MULTIPOINT((1 1),(2 2)) |
+---------------------------------------+

bottom of page