In the alSAMSBilling version asb071012 added new feature:
Grouping URLs in the user statistic by sub-domain
This function will work only if your MySQL server version is higger than 5.0 (because you’ll should add user function to the MySQL and version < 5.0 doesn’t support it). Code for the function you’ll find in the file ufunct.sql. (function should be created in the squldlog database!)
Thanks to the Richard K Miller (www.richardkmiller.com) for the function.