Reputation: 20140
I have a column of type varchar
with a time on it like 120217
. I would like to convert this to a time format I can query. Would something like
alter table public.table alter column col_time type date using to_date(col_time, 'HHMMSS');
work?
Upvotes: 0
Views: 1314
Reputation: 51649
this should do:
alter table public.table
alter column col_time
type time using (col_time::time);
Upvotes: 2