Help with SQL-query finding and updating uid's from non-existing users in comment table
I think this should do it. Make sure you take a backup before running this:

UPDATE {comments} SET uid = 0
WHERE uid &gt; 0
AND cid IN
(
  SELECT cid FROM {comments} AS comment
  LEFT JOIN {users} AS user 
  ON user.uid = comment.uid
  WHERE user.uid IS NULL
)