How to convert text column to datetime in SQL?
Comments
-
Step 1: Add new Column
ALTER TABLE table_name ADD (duplicate_column datetime);
Step 2: Update new Column with existing valueUPDATE table_name SET duplicate_column = str_to_date(column_name, '%d-%m-%Y %h:%i:%s');
Howdy, Stranger!