- Joined
- Apr 13, 2008
- Messages
- 1,244
- Reaction score
- 656
A simple query to delete empty Guilds (when they have only GuildMasters)!
Use this at your own risk! (Cuz what if the Guild is made just yet... It will be deleted ^^)
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 ^^)