Posts by Eduardo Silva • 111 points
2 posts
-
0
votes1
answer46
viewsA: Query to remove duplicates entering apparent infinite loop
First you need to know which lines are duplicated. Then undo all but one. So: DELETE A FROM tbl_atividades A INNER JOIN ( SELECT MIN(codigo) AS codigo, cod, tipo_atividade, dt_vencimento, COUNT(*)…
-
1
votes2
answers46
viewsA: Insert records that only exist in the source table with MERGE
I think you have to remove the conditions from the initial query and put their conditions as columns. So you will make MATCH whenever there is registration (regardless of the other conditions) but…