SQL query separated by space

3

I have the following sql query:

$sql= mysql_query("SELECT dia, GROUP_CONCAT(hora) FROM marcacoes WHERE colaborador_id = {$colaborador_id} GROUP BY dia ");

The result is:

07: 30: 00: 00: 00,13: 30: 00: 17: 00: 00

How do I get the comma separated by space?

ex: 07:30:00 12:00:00 AM 13:30:00 17:00:00

    
asked by anonymous 09.07.2016 / 13:59

1 answer

2

In the GROUP_CONCAT () function, define the delimiter with the keyword SEPARATOR .

Scope

GROUP_CONCAT(string SEPARATOR 'delimitador')

Complete example:

$sql= mysql_query("SELECT dia, GROUP_CONCAT(hora, SEPARATOR ' ') FROM marcacoes WHERE colaborador_id = {$colaborador_id} GROUP BY dia ");
    
09.07.2016 / 14:57