// Delete any items that have duplicate remote ids
Stringtable=tables[i];
StringdeleteDuplicates=String.format("DELETE FROM %s WHERE %s IN (SELECT %s.%s FROM %s, %s AS t2 WHERE %s.%s < t2.%s AND %s.%s = t2.%s AND %s.%s > 0 GROUP BY %s.%s)",
// Delete any items that have duplicate remote ids
// Change all items with remote id = 0 to be remote id = NULL
StringdeleteDuplicates=String.format("DELETE FROM %s WHERE %s IN (SELECT %s.%s FROM %s, %s AS t2 WHERE %s.%s < t2.%s AND %s.%s = t2.%s AND %s.%s > 0 GROUP BY %s.%s)",
StringchangeZeroes=String.format("UPDATE %s SET %s = NULL WHERE %s = 0",tasks,remoteId,remoteId);