Ver Mensaje Individual
  #3 (permalink)  
Antiguo 25/05/2010, 12:51
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: Inertar 3 333 en campo numerico?¿?¿?¿?

Código MySQL:
Ver original
  1. mysql> create table numero3(num integer);
  2. Query OK, 0 rows affected (0.01 sec)
  3.  
  4. mysql> insert into numero3 values(3 333);
  5. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '333)' at line 1
  6. mysql> insert into numero3 values(CAST(replace('3 333',' ','') as unsigned));
  7. Query OK, 1 row affected (0.01 sec)
  8.  
  9. mysql> select *from numero3;
  10. +------+
  11. | num  |
  12. +------+
  13. | 3333 |
  14. +------+
  15. 1 row in set (0.00 sec)
  16.  
  17. mysql>
__________________
Without data, You are another person with an opinion.
W. Edwads Deming