I would like to select and insert data from an old table to the new table:
CREATE TABLE test2 LIKE test1
INSERT INTO test2 SELECT timestamp, datenum FROM test1 WHERE datenum>=23 and datenum<=1000000 ON DUPLICATE KEY UPDATE datenum=VALUES(datenum)
Also I have and id
column in the test2 and test1, but I would like to start the id
from 1. If I use the query above I'm receiving the following error
ERROR 1136: Column count doesn't match value count at row 1
INSERT INTO test2 SELECT * FROM test1 WHERE datenum>=23 and datenum<=1000000 ON DUPLICATE KEY UPDATE datenum=VALUES(datenum)
In this case the id start from 3239.