Delete Guilds With No Members
Published: Comment: No Comments
Last Modified:2023-12-19 01:22:15
A simple query to delete empty Guilds (when they have only GuildMasters)!
Code:
alter table guild nocheck constraint all
alter table guildmember nocheck constraint all
delete from guild
where EXISTS (
SELECT m.G_Name,count(*) as memb from GuildMember m
where guild.g_name=m.G_name
group by m.G_Name
having count(*) <2
)
Use this at your own risk! (Cuz what if the Guild is made just yet... It will be deleted ^^)