I have an sql insert statement, for example.
INSERT INTO `table_a` (`col_a`, `col_b`, `col_c`, `col_d`) VALUES
(1, 2, 3, 4),
(2, 1, 6, 9),
(3, 1, 4, 5)
I want to insert this into another table, however the table I want to insert into has a different structure than the structure of the sql operator (it has fewer fields), for example.
table_b has columns 'col_a', 'col_b', 'col_d'
What do I need to do with the original sql status so that I can insert it into table_b. I assume it will be something like just ignoring the value that is in col_c and just sending it to the temp variable, not the field.eg
INSERT INTO `table_b` (`col_a`, `col_b`, @temp_var, `col_d`) VALUES
(1, 2, 3, 4),
(2, 1, 6, 9),
(3, 1, 4, 5)