FANDOM


SELECT
  COUNT(*)
FROM
  users
WHERE
  user_level <> 1 AND
  user_posts = 0;

CREATE TEMPORARY TABLE
  inactivos
SELECT
  user_id
FROM
  users
WHERE
  user_level <> 1 AND
  user_posts = 0;

DELETE FROM
  user_group
USING
  user_group,
  inactivos
WHERE
  user_group.user_id = inactivos.user_id;
  
DELETE FROM
  banlist
USING
  banlist,
  inactivos
WHERE
  banlist.ban_userid = inactivos.user_id;
  
DELETE FROM
  sessions
USING
  sessions,
  inactivos
WHERE
  sessions.session_user_id = inactivos.user_id;
  
DELETE FROM
  sessions_keys
USING
  sessions_keys,
  inactivos
WHERE
  sessions_keys.user_id = inactivos.user_id;
  
DELETE FROM
  topics_watch
USING
  topics_watch,
  inactivos
WHERE
  topics_watch.user_id = inactivos.user_id;
  
DELETE FROM
  users
USING
  users,
  inactivos
WHERE
  users.user_id = inactivos.user_id;
  
DELETE FROM
  vote_voters
USING
  vote_voters,
  inactivos
WHERE
  vote_voters.vote_user_id = inactivos.user_id;
El contenido de la comunidad está disponible bajo CC-BY-SA a menos que se indique lo contrario.