1
I am copying the records from one table to another in different databases, but a column in the new table cannot be null and the data coming from the old table are null.
Is there a way to put some conditional to "turn" the null fields into something I want ?
Below the query I’m using
insert into banco_novo.cliente (codcliente, nome, cpf, rg, sexo, data_nascimento, endereco, bairro, cidade, estado, cep) (select codcliente, nome, cpf, rg, sexo, data_nascimento, endereco, bairro, cidade, estado, cep from banco_antigo.cliente)
You can use a Insert Select and in the
select
set the condition for fields that will be null.– gato