|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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
|
|
#3
|
|||
|
|||
|
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! |
|
#4
|
|||
|
|||
|
I am pretty sure u can't do it
|
|
#5
|
|||
|
|||
|
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... |
|
#6
|
|||
|
|||
|
hey thanks gooky!
I appreciate it. |
|
#7
|
|||
|
|||
|
Hi,
Try this: update sample set email = concat(substring(email, 1, instr(email, '@')), 'webmail.com'); Nothing is impossible in SQL! |
|
#8
|
|||
|
|||
|
that's nice!
|
|
#9
|
|||
|
|||
|
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! |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > My SQl...query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|