Posted on 2011-09-14
Last Modified: 2012-05-12

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

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

for example:


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

the output I need is this:


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

Question by:lulu50
LVL 73

Accepted Solution

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

LVL 21

Expert Comment

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



Author Closing Comment

ID: 36537969

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Sending a Secure fax is easy with eFax Corporate ( First, just open a new email message. In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now