SQL中update的时候条件的问题

2025-03-23 04:59:52
推荐回答(2个)
回答1:

update 表名 set score = 90 where id=001;update 表名 set score = 95 where id=002;
...多条语句用分号隔开

回答2:

update test set score=(case when id=001 then 90 when id=002 then 80 end);