SQL循环更字段的值
来源:互联网 发布:Laymine java 编辑:程序博客网 时间:2024/06/10 01:42
/* total count for the query result */declare @totalcount intdeclare @rownum intselect @totalcount = (select count(1) from Table)set @rownum = 1while @rownum <= @totalcount begindeclare @num int declare @id decimal(18,0) select @id=ID from (select ROW_NUMBER() over(order by id) as rows,ID from Table) U where rows =@rownum set @num=(select distinct len(replace(name,'-','--'))-len(name) from Table WHERE ID=@id) IF(@num>=3)SET @num=3 update Table set CengJi = @num where [id] = @id set @rownum = @rownum + 1 end GO
0 0
- SQL循环更字段的值
- sql id循环设置字段值
- SQL 在循环内修改字段值
- sql 字段值的拼接
- sql server中如何循环添加字段
- SQl Update 某字段的部分值
- sql 如何查询 空值的字段
- SQL批量修改某一个字段的值
- 更新字段的sql
- 更快的sql语句
- SQL新增有默认值字段的字段
- SQL 字段取字符位置与循环修改数据
- sql:A表的D字段就是B表的E字段,D字段的值覆盖到E字段,只覆盖E字段为空的
- AWK 使用循环取出所有的字段
- 读取sql server表的字段名,字段类型,字段长度,字段属性的sql语句
- 读取sql server表的字段名,字段类型,字段长度,字段属性的sql语句
- SQL SERVER的字段类型
- SQL SERVER的字段类型
- iOS中NSString转float失真问题的解决办法
- Apalis TK1 运行 Android 7.1
- 关于Linux-网络通信工具
- Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't
- mysql-Innodb事务隔离级别-repeatable read详解(转)
- SQL循环更字段的值
- 修改Android7.1.1里的Settings使设备能默认安装未知来源的应用
- TCP、UDP、IP 协议分析
- stylus用法
- 调用函数
- Java面向对象设计模式(二十三)——解释器模式(Interpreter)
- 设置springboot启动端口
- 网页版简历
- 114Mall快速编译之FreeLine 安装指南Mac