Concatenate two sql

5

I have the records:

|DT_OBS  | DESC_OBS | COD_TURNO | COD_PERIODO|
|01.10.16|  TESTE 01|     1     |   1        |
|01.10.16|  TESTE 02|     2     |   1        |
|01.10.16|  TESTE 03|     1     |   2        |
|02.10.16|  TESTE 04|     1     |   1        |
|02.10.16|  TESTE 05|     1     |   2        |

I want you to return:

|DT_OBS  | DESC_OBS |
|01.10.16|  TESTE 01TESTE 02TESTE 03
|02.10.16|  TESTE 04TESTE 05

How do I merge DESC_OBS?

    
asked by anonymous 04.11.2016 / 18:44

1 answer

8

Since version 2.1, the LIST() function does what you want:

SELECT
  DT_OBS,
  LIST(DESC_OBS) AS LISTA_OBS
FROM
  registros
GROUP BY
  DT_OBS

% FireBird% is similar to MySQL%%, but without the option to sort the results.

    
04.11.2016 / 18:50