sqlite change date format of every cell in column
问题 I have a table with a large number of rows. One column contains dates in the format '%m/%d/%Y' and I want to change all of them to format '%Y-%m-%d' the usual: update table set mydate = '6' doesn't work I guess because the date is always changing. How would I do that in this case? 回答1: If the fields in the date string are properly padded with zeros, you can extract them as substrings: UPDATE MyTable SET MyDate = substr(MyDate, 7, 4) || '-' || substr(MyDate, 1, 2) || '-' || substr(MyDate, 4, 2