On Apr 27, 2005, at 1:17 PM, Eric Jensen wrote:

Trying to make some queries a little more efficient. I want to group
HTTP referers together but not with the full URL. For example, just
"www.google.com" instead of the full search string. I can't find a way
to do this in MySQL. Is there a way to turn
"http://search.msn.com/results.aspx?q=things+stuff&FORM=SSRE"; into
"search.msn.com" in a SELECT statement? Otherwise I have to loop
through them all and parse them myself and run more queries then necessary.

It seems like it would be far more efficient to index this during insertion. Then you don't have to loop through anything.


SELECT * FROM referrers,domains WHERE referrer.domain_id=domains.id AND domain.name = "www.google.com";

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to