remove_duplicates.sql 265 B

123456789
  1. DELETE FROM event_to_state_groups WHERE state_group not in (
  2. SELECT MAX(state_group) FROM event_to_state_groups GROUP BY event_id
  3. );
  4. DELETE FROM event_to_state_groups WHERE rowid not in (
  5. SELECT MIN(rowid) FROM event_to_state_groups GROUP BY event_id
  6. );