0

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?

BlitZ
  • 12,038
  • 3
  • 49
  • 68
Art
  • 3
  • 1
  • 3

1 Answers1

5

Remove VALUES and braces, exclude SELECT:

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

Read more here.

BlitZ
  • 12,038
  • 3
  • 49
  • 68