Solved

Erase some values in a field, leave the rest alone

Posted on 2013-01-04
2
229 Views
Last Modified: 2013-01-08
I have a table with a field called 'Website'

Some of the info is entered like this:  google.com

Some of it like this:  www.google.com

and Some like this: http://www..google.com

How can I parse all the fields so that all the records will all show the domain.com only, erasing  the rest?

Thanks
0
Comment
Question by:Rush_2112
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 500 total points
ID: 38745837
Try:
UPDATE `tblWebsite` SET `Website`= SUBSTRING(`Website`,8) WHERE SUBSTRING(`Website`,1,7)='http://'

Open in new window

followed by
UPDATE `tblWebsite` SET `Website`= SUBSTRING(`Website`,5) WHERE SUBSTRING(`Website`,1,4)='www.'

Open in new window

Note that not all websites are configured to work without www.
0
 
LVL 1

Author Closing Comment

by:Rush_2112
ID: 38756046
Worked perfectly, thank you!
0

Featured Post

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question