[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Update fields

Posted on 2009-12-21
2
Medium Priority
?
131 Views
Last Modified: 2012-05-08
Hi,
I have a table called MyTable and have few columns in it.  There is a field called Relation but this field may contain the following attributes:
Affiliate
OBR
OBR_XX
Non_OBR

So I want to update the MyTable -  where ever it find OBR_XX and Non_OBR in the Relation field; I want to change into OBR.  At the end the Relationship field should only contain this:
Affiliate
OBR
0
Comment
Question by:karinos57
2 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 1000 total points
ID: 26099595
update Mytable
set Relation = 'OBR'
WHERE Relation in ( 'OBR_XX' , 'Non_OBR' )
0
 

Expert Comment

by:devatdt
ID: 26102332
Other wise u can use this
update Mytable
set Relation = 'OBR'
WHERE Relation like '%OBR%'
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

872 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