如何仅更新仅在项目列中出现一次的那些项目的ID值?
表格1
id | item | price
-------------
10 | pen | 10
20 | pen | 10
30 | pen | 10
30 | copy | 10
10 | book | 10
10 | ball | 10
最佳答案
update table set
id = <whatever>
where
item in (select item from table group by item having count(*)=1)
关于sql - 如何更新仅显示一次的列中的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50490796/