As the question says, both tables are in the same database and both have the same fields (such as telephone address name etc ...) with the difference that table A (original table containing the data) has 1 field more than table B (table where the data goes) field that in table B is not necessary and should not be copied
INSERT INTO file (FILE, NOMPAC, DATE, AGE_A, EDAD_M, SEX, ADDRESS, CITY, TEL, CODSER, CHANNEL, CODDOC, KEY, KEY2, KEY3, cie10) SELECT * FROM dead WHERE RECORD = '0481/02 ';
for example with that statement I transfer all the information of the dead table (for this example it will be table A) and all inserting it to the table file (table B for this example)
This is the image of table B the fields it contains
And this is the image of the table A as you will see they have all the same fields with the exception of the field CODCAUSA which is precisely the field that I do not want nor should I go to table B
and this is the error that I get, which is quite clear, the problem is the column CODCAUSA that does not exist inside the table B and it should not exist then is there any way to exclude that data when inserting? Likewise, the same record transferred from table A to table B will be deleted so that the same data will be lost.
Error Code: 1136. Column count does not match value count at row 1