I have this table:
+----+----------------------------+---------+----------+
| id | coordenadas | latitud | longitud |
+----+----------------------------+---------+----------+
| 1 | -50.23232323,-100.74329430 | NULL | NULL |
| 2 | 51.506944,-0.1275 | NULL | NULL |
| 3 | 19.433333 | NULL | NULL |
+----+----------------------------+---------+----------
I use this query for separate the string by comma and insert into a new field:
UPDATE tabla SET
-> latitud = SUBSTRING(coordenadas,1,LOCATE(",",coordenadas) - 1);
and works fine.
The problem is the ID:3. Only have a value and it´s not separated by comma. That value don`t insert into the new field (Latitud).
How can I solve this problem?
Thanks