I have a database including time column that saves time as timestamps in a string format like '2020-10-19T04:49:15.651867Z' with Z at the end.
I want to select timestamps with the same day and put them into a new table. I have tried the following:
CREATE TABLE new_table AS (SELECT * FROM old_table WHERE DAY(time) = 20)
and I get ERROR 1292 (22007): Truncated incorrect datetime value: '2020-10-19T04:49:15.651867Z'.
I thought the problem is with DAY(time) = 20 but the following code works well and shows all entries with the same day:
SELECT * FROM old_table WHERE DAY(time) = '20';
Can you please help me?