Help with grouping in query
OK... I have a database where I enter stats about who's viewing my site (Country, Browser Type, etc), and one of these fields is the Referring URL. I'm making a query that gives me a count of how many visitors I get from different URLS. I'll use google for this example.
My query is:
SELECT COUNT(RefURL) AS ReferCount, RefURL
WHERE (RefURL <> '')
GROUP BY RefURL
This works great, except for one thing... it sees http://google.com and http://www.google.com as different sites... is there anyways I can parse the RefURL strings and just compare them on the domain?
Thanks in advance
Last edited by jrkeyboard; 03-31-2006 at 10:00 AM.
You should be handling that on your insert, either at the application or as part of a trigger, not on your output.
otherwise, create a view to do it.
It is being taken care of on the insert now... but since I didn't think it through before starting the data collection, it doesn't help for all the past data...
Just going on the data from here on out wouldn't be the worst thing in the world, but I just thought I'd see if there was any way the old data wouldn't have to be wasted
And I'm not familiar with views... I'll have to check on that
I've got this taken care of... I wrote up a script that went through and formatted all the existing RefURL's so that they only contain "google.com" now...
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)