Combining two update queries

Hi,
Can anybody help me....I have data in a column which contain:
Fulltime
Fultime
Fulltime
Partime
Partime

Now I want to change all fulltime words with Waiting and partime words with Placed.

Do you know how to do this?
DhehienAsked:
Who is Participating?
 
BinuthConnect With a Mentor Commented:
hmm.. your column not allow null values...
try now

update tableName
        set ColName = case when ColName= 'Fulltime' then 'Waiting' 
                                 else
                                        case when ColName= 'Partime' then 'Placed' else ColName  end
                                end

Open in new window

0
 
BinuthCommented:
try this
update tableName
	set ColName = case when ColName= 'Fulltime' then 'Waiting' 
				 else
					case when ColName= 'Partime' then 'Placed' end
				end

Open in new window

0
 
divyeshhdoshiCommented:
update <tablename>
set <columnname> =
                      case <columnname>
                               when 'Fulltime' then 'Waiting' when 'Partime' then 'Placed'
                      End
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
DhehienAuthor Commented:
It doesn't work, it says "cannot update (column_name) to null"
0
 
DhehienAuthor Commented:
Thanks heaps, It works!!!!
0
 
DhehienAuthor Commented:
Awesome
0
 
DhehienAuthor Commented:
Hi...the data in the column that just  changed was created from other table, apparently it also change the original data. Is there anyway to avoid this?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.