I need to insert data from table1 to table2. However, I would like to set the myYear column in table2 until 2010. But in table 1 there is no column myYear.
So my main insert looks like this:
INSERT INTO `table2` ( place, event ) SELECT place, event FROM table1
Roughly, I would like to do something like the following:
INSERT INTO `table2` ( place, event, SET myYear='2010' ) ...
Is there a way to set the column value in an insert statement?
mysql insert
Laxmidi
source share