Jump to content
  • 0

Simple SQL query to remove Guild Members but NO Guild Leaders


Question

Posted (edited)

Hello just asking... how to make 2 simple queries on a rathena database.

Query 1:

How a sql query on a rAthena database, would be... to remove all the lines into the 'guild_member' table but not the lines that has char guild master that are into the 'guild' table.

the 'char_id' column is common on both tables.

Query 2:

To do a query to set the 'guild_id' column inside the 'char' table to the value = '0' to all the lines but, not the lines that has char guild master into the 'guild' table

Again, the 'char_id' column is common on bot 'char' and 'guild' table on this one.

Why I'm doing this? I'm reducing the max_guild_size of one server, and I need to clean the guild members, so all the guilds will have only 1 member (guild master).

Thanks in advance

Edited by Olrox

2 answers to this question

Recommended Posts

Posted (edited)

DELETE FROM guild_member WHERE char_id NOT IN (SELECT char_id FROM guild);

UPDATE `char` SET guild_id=0 WHERE char_id NOT IN (SELECT char_id FROM guild);

edit: you're welcome!

Edited by Brian

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...