Reputation: 33
How would I update all row values of a SQL table in a column when the value equals a certain value?
For Example (TableA):
ColumnA | ColumnB | ColumnC
---------------------------
a | b | c
a | x | c
a | x | c
a | x | c
a | b | c
a | b | c
I would I rename all x
in ColumnB to y
?
Upvotes: 0
Views: 4271
Reputation: 1269463
If I understand correctly, this is simple update:
update tableA
set columnb = 'y'
where columnb = 'x';
Upvotes: 8