#SELECT substring_index(coordinate,',', 1), substring_index(coordinate,',', -1) FROM tmp a LEFT JOIN table b on a.uid = b.uid WHERE;
UPDATE tmp a LEFT JOIN table b on a.uid = b.uid SET b.lgt = substring_index(a.coordinate,',', -1), b.lat=substring_index(a.coordinate,',', 1);
UPDATE tmp a LEFT JOIN table b on a.uid = b.uid SET b.lgt = substring_index(a.coordinate,',', -1), b.lat=substring_index(a.coordinate,',', 1);
本文介绍了一种使用SQL语句来处理坐标数据的方法,通过LEFT JOIN结合substring_index函数实现坐标值的拆分与更新。此方法适用于需要对地理坐标进行操作的场景。
1万+

被折叠的 条评论
为什么被折叠?



