?
Solved

Update

Posted on 2011-09-14
3
Medium Priority
?
250 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
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
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…
Suggested Courses

840 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