2
I have a column timestamp on my table and I need to get only the time of these values.
Example of how you are registered: 30.12.1899 17:03
Example of how I need to display through 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
There’s an easier way for me to get the same result?
NOTE: I only need the hour with two decimal places, the minutes will be fixed, that is, it will always be 00.
Man, I don’t understand the language in question, but analyzing programmatically, I think the code is already straight and easy.
– Sam