I have two tables table1 and table2, I want to enter the data from table1 in table2, but there are duplicates

1

I added a new field to the table 1 of the name delete to mark the ones that are duplicates and that are marked in 1 with the following code, but when you delete them and try to upload them, they still appear duplicates

select count(*) from tabla1 where borrar is not null

update tabla1 set borrar = 1
from tabla2 t
inner join tabbla 1 tt on t.id_tipo_identificacion = tt.id_tipo_identificacion and t.nro_identificacion = tt.nro_identificacion

the third table does not support duplicates per PK

    
asked by Andrex_11 05.01.2018 в 21:07
source

0 answers