MySQL Regex or Split
Nicholas Leippe
nick at byu.edu
Wed Apr 27 12:26:18 MDT 2005
On Wednesday 27 April 2005 11:02 am, 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.
You can probably get by using substring(), locate(), and a little bit of
logic.
If you need absolute speed, consider writing a udf--it's really not hard to
do.
--
Respectfully,
Nicholas Leippe
Sales Team Automation, LLC
1335 West 1650 North, Suite C
Springville, UT 84663 +1 801.853.4090
http://www.salesteamautomation.com
More information about the PLUG
mailing list