Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/06/2010, 07:46
Avatar de huesos52
huesos52
Colaborador
 
Fecha de Ingreso: febrero-2009
Ubicación: Manizales - Colombia
Mensajes: 5.980
Antigüedad: 15 años, 3 meses
Puntos: 360
Respuesta: Consulta mysql

Código MySQL:
Ver original
  1. mysql> DESC coordenadas;
  2. +----------+------+------+-----+---------+-------+
  3. | Field    | Type | Null | Key | Default | Extra |
  4. +----------+------+------+-----+---------+-------+
  5. | latitud  | text | YES  |     | NULL    |       |
  6. | longitud | text | YES  |     | NULL    |       |
  7. | lat_lon  | text | YES  |     | NULL    |       |
  8. +----------+------+------+-----+---------+-------+
  9. 3 rows in set (0.03 sec)
  10.  
  11. mysql> INSERT INTO coordenadas (latitud,longitud) VALUES('65','73');
  12. Query OK, 1 row affected (0.00 sec)
  13.  
  14. mysql> SELECT *FROM coordenadas;
  15. +---------+----------+---------+
  16. | latitud | longitud | lat_lon |
  17. +---------+----------+---------+
  18. | 65      | 73       | NULL    |
  19. +---------+----------+---------+
  20. 1 row in set (0.02 sec)
  21.  
  22. mysql> UPDATE coordenadas SET lat_lon=CONCAT(latitud,' ',longitud);
  23. Query OK, 1 row affected (0.00 sec)
  24. Rows matched: 1  Changed: 1  Warnings: 0
  25.  
  26. mysql> SELECT *FROM coordenadas;
  27. +---------+----------+---------+
  28. | latitud | longitud | lat_lon |
  29. +---------+----------+---------+
  30. | 65      | 73       | 65 73   |
  31. +---------+----------+---------+
  32. 1 row in set (0.00 sec)

así?
__________________
Without data, You are another person with an opinion.
W. Edwads Deming