我有一张像这样的表:
ID address note
1 addr1 day1
2 addr2 day1
3 addr3 day1
4 addr4 day1
5 addr5 day1
6 addr6
7 addr7
8 addr8
9 addr9
10 addr10
如何使用UPDATE将值“day2”批量添加到6到10行的“note”列? 谢谢
答案 0 :(得分:2)
你会这样做:
update t
set note = 'day2'
where id between 6 and 10;
但是,您可能需要:
update t
set note = 'day2'
where note is null;