更新一个部门的人员编号为‘5000’开头的SQL语句怎么写并且末尾是按流水号排的

来源:百度知道 编辑:UC知道 时间:2024/05/16 11:43:37

看你写的结构应该是编号为int型,而且有索引
所以应该这么写
update Table1 set XX=更新内容 where cast(id as varchar(10)) like '5000%'
当然会影响执行效率
如果知道末尾的位数应该方便一点,比如3位
update Table1 set XX=更新内容 where id between 5000001 and 5000999

update 表名 set 修改内容 where 编号字段名 like '5000%'