0
I have the following problem, at source I have the data coming as varchar
example of data source in varchar format:
- 08:15:49
- 18:16:05
- 20:01:33
etc....
I need to reinsert this data into a new table so I did an Insert with the following select
INSERT INTO NOVA_TABELA(
NOVO_CAMPO
)
SELECT
TO_TIMESTAMP(hora, 'HH24:MI:SS')
FROM TABELA_ANTIGA;
The problem is that I only need the time, and the timestamp is adding date next to the time
output from processing:
- 0001-01-01 08:15:49
- 0001-01-01 18:16:05
- 0001-01-01 20:01:33
I want you to just convert the source string to time without adding anything, but I’m not getting it...
considering the input data, it is no longer simple to just do the direct cast
hora::time
? Or, to stay within the ANSI SQL standard,CAST(hora as time)
?– nunks