Ver Mensaje Individual
  #6 (permalink)  
Antiguo 20/04/2009, 12:39
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: Ayuda con consulta

Que raro jurena.

Acabo de hacerlo y no me presenta problema por el campo. Debe ser cuestión de la versión de mysql. No noto ninguna diferencia entre varchar y numerico para hacer uso de group_concat

Código consulta:
Ver original
  1. mysql> desc tabla1;
  2. +--------+------------+------+-----+---------+-------+
  3. | Field  | Type       | Null | Key | Default | Extra |
  4. +--------+------------+------+-----+---------+-------+
  5. | id     | int(11)    | YES  |     | NULL    |       |
  6. | nombre | text       | YES  |     | NULL    |       |
  7. | puntos | float      | YES  |     | NULL    |       |
  8. | otro   | bigint(20) | YES  |     | NULL    |       |
  9. +--------+------------+------+-----+---------+-------+
  10. 4 rows in set (0.01 sec)
  11.  
  12. mysql> select *from tabla1;
  13. +------+----------------------+--------+-------------+
  14. | id   | nombre               | puntos | otro        |
  15. +------+----------------------+--------+-------------+
  16. |    2 | daniela              |    150 | 23245353454 |
  17. |    3 | danielito            |     80 | 23245353454 |
  18. |    4 | danielita            |     60 | 23245353454 |
  19. |    5 | [email][email protected][/email] |     30 | 23245353454 |
  20. |    5 | [email][email protected][/email] |     30 | 23245353454 |
  21. |    6 | daniela              |    180 | 23245353454 |
  22. |    5 | huesos               |     30 |         256 |
  23. +------+----------------------+--------+-------------+
  24. 7 rows in set (0.00 sec)
  25.  
  26. mysql> select id, group_concat(otro separator ',') from tabla1 group by id;
  27. +------+----------------------------------+
  28. | id   | group_concat(otro separator ',') |
  29. +------+----------------------------------+
  30. |    2 | 23245353454                      |
  31. |    3 | 23245353454                      |
  32. |    4 | 23245353454                      |
  33. |    5 | 23245353454,23245353454,256      |
  34. |    6 | 23245353454                      |
  35. +------+----------------------------------+
  36. 5 rows in set (0.01 sec)
__________________
Without data, You are another person with an opinion.
W. Edwads Deming