MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 13th, 2000, 05:12 PM
suren suren is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Portland, OR
Posts: 4 suren User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have a table called 'sample' with five fields in it. In one of the fields called 'email' I have data with lots of entries which looks like ****@hotmail.com,xxx@hotmail.com.
I need to replace the "hotmail.com" with "webmail.com" without manually editing the whole table.
Can i do it with any commands in MySQL.
or are there any functions to use and change it.
thanks for the help.

Suren.

P.S..I am a beginner in SQL.


Reply With Quote
  #2  
Old August 13th, 2000, 06:08 PM
gooky gooky is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Denmark
Posts: 6 gooky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to gooky
I would make a script that makes the change... If you have access to Perl,Asp or PHP. I don't know if you can do it only using mysql

Reply With Quote
  #3  
Old August 13th, 2000, 06:29 PM
suren suren is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Portland, OR
Posts: 4 suren User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I need to try to make it work without using the script and I was wondering if there are any append kinda functions in MySQL.

I appreciate ur responses!

Thanks!

Reply With Quote
  #4  
Old August 13th, 2000, 06:35 PM
gooky gooky is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Denmark
Posts: 6 gooky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to gooky
I am pretty sure u can't do it

Reply With Quote
  #5  
Old August 13th, 2000, 06:44 PM
gooky gooky is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Denmark
Posts: 6 gooky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to gooky
you usually use:

update sample set mail='hans@webmail.com' where mail like '%hotmail.com';

But in this example you change all e-mail adresses containing hotmail.com in the end to an adress called hans@webmail.com.

I try figure something out, but it is late now and i will go to bed. Tomorrow i'll find out a solution.

By the way, I can easily(how do you spell that) make that script for you if you want...

Reply With Quote
  #6  
Old August 13th, 2000, 07:26 PM
suren suren is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Portland, OR
Posts: 4 suren User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hey thanks gooky!
I appreciate it.

Reply With Quote
  #7  
Old August 14th, 2000, 02:44 AM
woodgnome woodgnome is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 29 woodgnome User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 43 sec
Reputation Power: 0
Hi,

Try this:

update sample set email = concat(substring(email, 1, instr(email, '@')), 'webmail.com');

Nothing is impossible in SQL!

Reply With Quote
  #8  
Old August 14th, 2000, 03:32 AM
gooky gooky is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Denmark
Posts: 6 gooky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to gooky
that's nice!


Reply With Quote
  #9  
Old August 14th, 2000, 03:58 AM
suren suren is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Portland, OR
Posts: 4 suren User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks dude!
I am amazed....hey u guys just drawn me into this field..gimme some pointers as to where I could find and master this stuff.

Suren!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > My SQl...query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT