sqlserver 游标的简单示例

2023年 4月 16日 28.1k 0

Declare @Id varchar(20) Declare @Name varchar(20) Declare Cur Cursor For select substring(id,0,7) as id,name from temp1 Open Cur Fetch next From Cur Into @Id,@Name While @@fetch_status=0 Begin Update temp Set [c3]=@Name where [id] like @Id+

Declare @Id varchar(20) Declare @Name varchar(20) Declare Cur Cursor For select substring(id,0,7) as id,name from temp1 Open Cur Fetch next From Cur Into @Id,@Name While @@fetch_status=0 Begin Update temp Set [c3]=@Name where [id] like @Id+'%' Fetch Next From Cur Into @Id,@Name End Close Cur Deallocate Cur

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论