I have this SQL
command to update the REQUISICOES
table with the data in the REQUISICOES_ATUALIZA
table.
Use as a key to update the field number_requisition, but I need that if I do not find correspondencia
in the REQUISICOES
table, insert a new record from the REQUISICOES_ATUALIZA
table;
This works to update:
UPDATE requisicoes a
JOIN requisicoes_atualiza b
SET a.projeto = b.projeto
WHERE a.numero_requisicao = b.numero_requisicao
And how would SQL be for those that do not exist?