Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2010
    Posts
    31
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Need query to part change data in each row.

    Hello
    I have a MySQL table with around 20,000 rows.
    One of the fields in each row contains url data. I need to change only part of the url from each row, leaving the rest intact. Is it possible to do?

    e.g.
    all rows currently: http://www.xxx.uniqueID.com

    now need to be: http://www.zzz.uniqueID.com

    Many thanks for any help, it's appreciated.

    Tree

  • #2
    New Coder
    Join Date
    Aug 2010
    Posts
    31
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Just to let you know, I found what I needed -

    update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');

    thanks anyway

  • #3
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    rather simple right?
    Thanks for taking the time to post your solution, it will help others who come across your thread that are having problems solving in a similar situation.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •