?
Solved

Update

Posted on 2011-09-14
3
Medium Priority
?
247 Views
Last Modified: 2012-05-12
Hi,

how can write an update statement that would search in the churchName field that has "church" word and updated to this word
"Chr"


Update ChurchTbl
set ChurchTbl.ChurchName = (select ChurchTbl.ChurchName from ChurchTbl
where ChurchTbl.ChurchName like '%church%')

for example:

ChurchName

Ada Congregational Church
Community Reformed Church
Forest Hills Bible Chapel
Keystone Community Church

the output I need is this:

ChurchName

Ada Congregational Chr
Community Reformed Chr
Forest Hills Bible Chapel
Keystone Community Chr


0
Comment
Question by:lulu50
[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
3 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 2000 total points
ID: 36536971
Update ChurchTbl
set ChurchTbl.ChurchName = replace(ChurchName,'Church','Chr')
where ChurchName like '%Church%'

0
 
LVL 21

Expert Comment

by:JestersGrind
ID: 36536984
UPDATE ChurchTbl SET ChurchName = REPLACE(ChurchName, 'Church', 'Chr')

Greg

0
 

Author Closing Comment

by:lulu50
ID: 36537969
Thanks
0

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 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