Created
July 5, 2013 11:36
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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