Jump to content
  • 0

SQL Query Help


Linkin Park

Question


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

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.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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


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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

  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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

  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! :)

Link to comment
Share on other sites

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.

×
×
  • Create New...