With the query only
Select count(Name) as MembersTotal, G_Name as GuildName from GuildMember group by G_Name order by MembersTotal DEsc;
Create view Guilds as Select count(Name) as GuildMembersTotal, G_Name as GName from GuildMember group by G_Name;
Sorting example using Google Charts API.
Very simple and usefull for any web/mobile aplication that needs dynamic searches, pagination and filters without the need to create your own logic that will save a lot of time.