In partial answer to my own question, here's a SQL query that I
believe will identify duplicated rows
select count(a.type_id), a.type_id, a.units, a.royalty_price,
a.report_id, a.country_code, b.from_date from sale as a, report as b
where b.report_type_id = 0 and a.report_id =
b.id group by from_date,
country_code, type_id, units having count(a.type_id) >1
I have used this query and then evaluated the results row by row --
where possible comparing with iTunes Connect. I then deleted the
report and sale rows which were duplicates -- being careful to ensure
report ID consistency between the two tables.
I think this has solved the duplicate data problem but would be
interested to know if anyone has a better way to do this.
--Larry