• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved [MySQL] Deleting account with no characters

Don Daniello

/root
Staff member
Administrator
Joined
Apr 11, 2008
Messages
3,728
Solutions
16
Reaction score
1,520
Location
Proland
Hi,
I have question to some advanced users of MySQL.
I want to delete accounts which don't have any characters.
I have over 16 000 accounts and only 2 000 players (after database cleaning).
I know it requires advanced MySQL code with 'If's but I don't know how to do this.

Could you help me ?
Ofc reput point as reward :)
 
Last edited:
Solution for deleting accounts with no characters:
PHP:
SELECT * FROM accounts WHERE id NOT IN (SELECT account_id FROM players);
 
Last edited:
crazy ?



DELETE FROM accounts WHERE name NOT IN (SELECT name FROM players);

delete all accounts where name of player not = ?
omg.


correct command.

DELETE FROM accounts WHERE id NOT IN (SELECT account_id FROM players)
 
Last edited:

Similar threads

Back
Top