carltonb
carltonb

Reputation: 1

Update Column based on another field

My table is labeled 'media' I have a field called 'mediatypeID' it contains data like book, magazine. I have a field called 'location' where that piece of media is located. So for instance books are located on shelf1 I have changed the location of my books and I need to edit that information. I want to search db table 'media' where the media type is 'book' and change the data in the field location to 'shelf3'.

how do I create a statement to do this. Thank you

Upvotes: 0

Views: 26

Answers (1)

Blake
Blake

Reputation: 1327

UPDATE media SET location='shelf3' WHERE mediatypeID='book'

Upvotes: 1

Related Questions