Jump to content
  • 0

SQL Query Help


Question

Posted

Hi,

I need to remove all members of all the guilds except the guild master of the guilds in my database, how to do it?

It's like wiping all members of the guilds except the guild master to still save the guilds.

4 answers to this question

Recommended Posts

Posted (edited)

try run this in your SQL....make sure you do backup 1st just in case anything happen...


DELETE FROM `guild` WHERE `name` <> `master` ;

I don't think this is the right query as the guild members are located inside the guild_member table.

Will this query work?

DELETE FROM `guild_member` where position <> 0

Edited by RaGERO
Posted

  1. stop the login, char, and map servers
  2. run this first SQL query:
    DELETE FROM `guild_member` WHERE `char_id` NOT IN (SELECT `char_id` FROM `guild`);


  3. run this second SQL query:
    UPDATE `char` SET `guild_id`=0 WHERE `char_id` NOT IN (SELECT `char_id` FROM `guild_member`);

  • Upvote 1
Posted
  1. stop the login, char, and map servers
  2. run this first SQL query:
    DELETE FROM `guild_member` WHERE `char_id` NOT IN (SELECT `char_id` FROM `guild`);


  3. run this second SQL query:
    UPDATE `char` SET `guild_id`=0 WHERE `char_id` NOT IN (SELECT `char_id` FROM `guild_member`);


Thank you! :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...