-2
Talk personal, all right? So, I made a mistake of issuing billets with the same unique number. I need to update in the table which are these duplicate records. The query that makes this identification correct and shows me duplicate records, but when updating, updates all records. I don’t understand where I’m going wrong. Thanks a lot!!!
UPDATE bol_remessa set duplicado = 'S'
WHERE bol_idassociado IN(
select t.bol_idassociado
from(
SELECT distinct rm.bol_idassociado
FROM bol_remessa rm
GROUP BY rm.bol_idassociado
HAVING COUNT(rm.bol_numerodocumento) >1
) as t
)
Did you generate duplicates for just one associate? Or are there duplicates for several different associates? Another question, are there previous slips for these associates, say, from previous months correct? If yes, I believe it is enough to add a comparison with the date of issue of the tickets
– Ademir Mazer Jr - Nuno