sql批量插入一个数据

来源:百度知道 编辑:UC知道 时间:2024/06/17 05:19:45
我有一个表city

我要把'中国' 插入表中字段big_home 大概是1000条

怎么写语句呢
我要的是修改

条件是big_home不等于'中国'的都改成中国

具体怎么写呢

我很菜

修改
update city set con='中国' where 根据情况加条件

就这样就可以了
update city set big_home='中国' where big_home!='中国'

你要的是不是在城市名前增加中国两个字?
update city set big_home='中国'+big_home where big_home!='中国'
如果只是修改成中国
一楼的就好

update city set big_home='中国'
最简洁的就是这种,但是这种效率低,因为没有加条件过滤.
所以可以改成为样,效率可能会提高一点:
update city set big_home='中国' where big_home<>'中国'

update city set big_home='中国' where big_home<>'中国'
或者
update city set big_home='中国'
你想反正你要的结果都是big_home='中国'这样也能达到你的目的而且还效率