
1 lichao 2013-07-10 15:30:22 +08:00 update tb set name = name + cast(id as varchar(10)) where name in ( select name from tb group by name having count(*) > 1 ) |
2 zhttty OP @lichao 你的有误的,不能同时查出表又同时修改表... You can't specify target table 'test' for update in FROM clause 不过还是提供了些思路。 |
4 66beta 2013-07-10 16:08:55 +08:00 视图可以吗? |
5 keakon 2013-07-10 16:21:02 +08:00 你的需求有问题吧 如果是这样的: id name 1 a 2 a1 3 a12 你要怎么改名? |
6 lichao 2013-07-10 16:21:19 +08:00 |