DELETE FROM events
WHERE rowid NOT IN (
  SELECT MIN(rowid)
  FROM events
  GROUP BY uid
);