Reputation: 1230
So, I have to write a sql script to update 2 values on the same columns with a different ID from an ITEM table. Here is what I write:
UPDATE ITEM
SET ArtistName = 'Rex Baker'
WHERE ItemNumber = 2
AND ItemNumber = 4;
However, it does not work at all. Can anyone tell me what I did wrong ? and how can I fix it ? Thank you
Upvotes: 0
Views: 225
Reputation: 204924
Use or
or in
UPDATE ITEM
SET ArtistName = 'Rex Baker'
WHERE ItemNumber = 2
OR ItemNumber = 4;
UPDATE ITEM
SET ArtistName = 'Rex Baker'
WHERE ItemNumber IN (2,4);
Upvotes: 8