Skip to content

Instantly share code, notes, and snippets.

@umidjons
Created July 5, 2013 11:36
Show Gist options
  • Select an option

  • Save umidjons/5933962 to your computer and use it in GitHub Desktop.

Select an option

Save umidjons/5933962 to your computer and use it in GitHub Desktop.
Convert date string to date and insert into another table For example, string '14.03.2013' becomes '2013-03-14' date.
INSERT INTO other_table (num, c_date)
SELECT lic_num, STR_TO_DATE(lic_date,'%d.%m.%Y') /* converts date from %d.%m.%Y to %Y-%m-%d format */
FROM my_table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment