SQL question using PIVOT, no aggregation column

SQL question using PIVOT, no aggregation column

I would like to do a PIVOT on my table but I don’t have aggregation column.

SELECT 
    CONVERT(date, DataHora) AS dia,
    CONVERT(VARCHAR(5), DataHora, 108) AS hora
FROM 
    [clientes].[dbo].[Tb_Ponto]

Result:

2021-12-27  12:41
2021-12-28  12:42
2021-12-28  13:03
2021-12-28  14:08

I would like it to stay like this:

2021-12-27  12:41 |  NULL | NULL 
2021-12-28  12:42 | 13:03 | 14:08

Related Posts