Link to home
Start Free TrialLog in
Avatar of Dhehien
Dhehien

asked on

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?
Avatar of Binuth
Binuth
Flag of India image

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

Avatar of divyeshhdoshi
divyeshhdoshi

update <tablename>
set <columnname> =
                      case <columnname>
                               when 'Fulltime' then 'Waiting' when 'Partime' then 'Placed'
                      End
Avatar of Dhehien

ASKER

It doesn't work, it says "cannot update (column_name) to null"
ASKER CERTIFIED SOLUTION
Avatar of Binuth
Binuth
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dhehien

ASKER

Thanks heaps, It works!!!!
Avatar of Dhehien

ASKER

Awesome
Avatar of Dhehien

ASKER

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?