Home Forums MYSQL Create new column with Existing value on other column in MySQL

Viewing 1 reply thread
  • Author
    Posts
    • #112
      avi
      Participant

      I have start_date(varchar) column and i want to add new column duplicate_date(date) with values of start_date column

    • #113
      avneesh
      Participant

      Step 1: Add new Column
      ALTER TABLE long_holiday ADD (duplicate_date DATE);
      Step 2: Update new Column with existing value
      UPDATE long_holiday SET duplicate_date = STR_TO_DATE(start_date , '%d-%m-%Y');

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
Scroll to Top