Art
Art

Reputation: 3

INSERT ... IGNORE from another table

I want to insert some records that comes from a table into another table using INSERT ... IGNORE:

INSERT IGNORE into separa (no_cliente,contratante) values (select cl_num,cl_aseg from clientes)

But MySQL tells that I'm wrong, any help?

Upvotes: 0

Views: 3891

Answers (1)

BlitZ
BlitZ

Reputation: 12168

Remove VALUES and braces, exclude SELECT:

INSERT IGNORE INTO separa (no_cliente, contratante)
SELECT cl_num, cl_aseg FROM clientes;

Read more here.

Upvotes: 5

Related Questions