I have two tables. Table A
is the main table, and table B
an auxiliary table. Now i need to copy from table B
to table A
only the rows with a aux_id
not present in table A
table_A
id |aux_id | firstname | lastname
table_B
aux_id | firstname | lastname
What I am trying, but apparently without success.
INSERT INTO table_A(aux_id,firstname,lastname)(SELECT aux_id,firstname,lastname FROM table_B WHERE aux_id != aux_id);
I am getting : INSERT 0 0
This is wrong, because i am sure that I have new entries in table B.