How to get only timestamp time?

2

I have a timestamp column in my table and I need to pick up only those time values.

Example of how you are registered: 30.12.1899 17:03

Example of how I need to display via select: 17:00

I got it this way:

SELECT
  CASE 
    WHEN Char_length(Extract(hour FROM coluna)) <= 1 THEN '0' ||  Extract( hour FROM coluna )  || ':00' 
    ELSE Extract(hour FROM coluna) || ':00' 
  end AS "DATA"
FROM   tabela

Is there an easier way for me to achieve the same result?

OBS: I only need the time with two decimal places, the minutes will be fixed, that is, it will always be 00.

    
asked by anonymous 16.08.2017 / 22:07

1 answer

2

In this way, you extract the Minutes and Seconds from the Firebird% field and date of Firebird see Here o Complete content on extract date and field time timestamp

SELECT EXTRACT (HOUR FROM tabela.Campo) ||
':' || EXTRACT (MINUTE FROM tabela.Campo) ||
':' || EXTRACT (SECOND FROM tabela.Campo) FROM tabela
    
04.10.2017 / 14:51