Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Replace a string based on a value in another field

Posted on 2012-03-15
2
Medium Priority
?
344 Views
Last Modified: 2012-03-15
I want to update the FullDescription field based on a value in the Name field :

SELECT Name
FROM  Nop_Product
WHERE (Name LIKE '%(MEN)%')    :

ACQUA DI PARMA by Acqua di Parma (MEN) COLOGNE SPRAY 3.4 OZ

FullDescription field :

<strong>ACQUA DI PARMA by Acqua di Parma</strong> - <span style='font-size:15px;'>Genuine Brand Name Perfume</span><p style='font-size:18px;color:black;padding-top:10px;padding-bottom:10px;'>COLOGNE SPRAY 3.4 OZ</p>Gender : MEN<br /><br />Brand : ACQUA DI PARMA<br /><br />Designer : Acqua di Parma<br /><br />Fragrance : rosemary, citrus, lavender

I want to replace the string : 'Genuine Brand Name Perfume' in FullDescription
with                                       'Genuine Brand Name Fragrance'

WHERE the string '(MEN)' is in the field 'Name'


UPDATE [Nop_Product]
SET  FullDescription =

 WHERE

What's the best way to do this? thanks
0
Comment
Question by:MikeMCSD
[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 42

Accepted Solution

by:
dqmq earned 2000 total points
ID: 37725713
This does what you asked:

UPDATE [Nop_Product]
SET  FullDescription =  replace(fulldescription,'Genuine Brand Name Perfume' ,'Genuine Brand Name Fragrance')
WHERE Name LIKE '%(MEN)%'

Now let's see where that's going to take us :>)
0
 
LVL 16

Author Closing Comment

by:MikeMCSD
ID: 37726018
thanks
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how the fundamental information of how to create a table.

670 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