Ver Mensaje Individual
  #4 (permalink)  
Antiguo 08/02/2010, 20:27
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: sumar 1 a registro sql

Te lo pongo en un ejemplo

Código MySQL:
Ver original
  1. mysql> select *from t1;
  2. +----+
  3. | id |
  4. +----+
  5. |  1 |
  6. |  2 |
  7. |  4 |
  8. |  5 |
  9. +----+
  10. 4 rows in set (0.00 sec)
  11.  
  12. mysql> insert into t1 select max(id)+1 from t1;
  13. Query OK, 1 row affected (0.00 sec)
  14. Records: 1  Duplicates: 0  Warnings: 0
  15.  
  16. mysql> select *from t1;
  17. +----+
  18. | id |
  19. +----+
  20. |  1 |
  21. |  2 |
  22. |  4 |
  23. |  5 |
  24. |  6 |
  25. +----+
  26. 5 rows in set (0.00 sec)
  27.  
  28. mysql>

sin embargo vuelvo e insisto... que problema tienes con usar una columna auto_increment?

saludos paisano
__________________
Without data, You are another person with an opinion.
W. Edwads Deming