Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/06/2009, 10:50
Avatar de huesos52
huesos52
Colaborador
 
Fecha de Ingreso: febrero-2009
Ubicación: Manizales - Colombia
Mensajes: 5.980
Antigüedad: 15 años, 2 meses
Puntos: 360
Respuesta: Reestructurar tabla y registros (mas de 2Mil)

Si te entendí bien, mira este ejemplo:

Código mysql:
Ver original
  1. mysql> create table tabla_1(campo1 text,campo2 text, campo3A text, campo3B text);
  2. Query OK, 0 rows affected (0.01 sec)
  3.  
  4. mysql> insert into tabla_1 values('1camp','2camp','3camp','4camp');
  5. Query OK, 1 row affected (0.00 sec)
  6.  
  7. mysql> create table tabla_2(campo1 text,campo2 text, nuevocampo3 text);
  8. Query OK, 0 rows affected (0.05 sec)
  9.  
  10. mysql> insert into tabla_2 select campo1,campo2,concat(campo3A," ",campo3B) from tabla_1;
  11. Query OK, 1 row affected (0.00 sec)
  12. Records: 1  Duplicates: 0  Warnings: 0
  13.  
  14. mysql> select *from tabla_2;
  15. +--------+--------+-------------+
  16. | campo1 | campo2 | nuevocampo3 |
  17. +--------+--------+-------------+
  18. | 1camp  | 2camp  | 3camp 4camp |
  19. +--------+--------+-------------+
  20. 1 row in set (0.00 sec)

Aplica para n registros.

Espero te sirva.
__________________
Without data, You are another person with an opinion.
W. Edwads Deming