1

I have an SQL database table, I want to find everything in a table where the 'Room' says 'DISPOSED', Insert 'DISPOSED' into the 'Status' field and then delete the entry in 'Room'.

Basically moving the entry from one field to another (if the 'Room' field has 'DISPOSED' in it)

Hope this makes sense.

Thanks for any help.

2 Answers 2

2
Update table_name SET room='', Stauts='DISPOSED' where Room='DISPOSED'

OR

Update table_name SET room=null, Stauts='DISPOSED' where Room='DISPOSED'
Sign up to request clarification or add additional context in comments.

Comments

0

The SQL is

UPDATE table SET status = room, room = null WHERE room = 'DISPOSED'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.