存储过程,把查询结果赋给变量
2006-07-27 15:59
357 查看
declare upcur cursor for
select (datediff(day,@st_date,@ed_date)+1)-2*datediff(ww,@st_date,@ed_date) --每月要输的天数,没考虑节假日
open upcur --打开
fetch next from upcur into @work_days
select @work_days
fetch next from upcur into @work_days
close upcur --关
deallocate upcur
select (datediff(day,@st_date,@ed_date)+1)-2*datediff(ww,@st_date,@ed_date) --每月要输的天数,没考虑节假日
open upcur --打开
fetch next from upcur into @work_days
select @work_days
fetch next from upcur into @work_days
close upcur --关
deallocate upcur
相关文章推荐
- Mysql存储过程查询结果赋值到变量的方法
- mysql将查询结果写入变量,存储过程
- Mysql存储过程查询结果赋值到变量的方法
- mysql存储过程判断不为空和不为空,查询结果赋值变量
- Mysql 存储过程查询结果赋值到变量的方法
- oracle之存储过程5-查询结果保存到变量中去
- Oracle 在函数或存储过程中执行sql查询字符串并将结果值赋值给变量
- Mysql 存储过程查询结果赋值到变量的方法
- mysql存储过程将查询结果传给变量
- Mysql存储过程查询结果赋值到变量的方法
- Mysql 存储过程查询结果赋值到变量的方法
- Mysql 存储过程查询结果赋值到变量的方法
- 用excel, notepad++ 快速整理sql字段名,并快速完成将某个存储过程的查询结果插入到某张表
- MYSQL存储过程查询返回结果处理方法
- 如何在存储过程内部获得查询的结果
- 09存储过程查询-多个结果集
- 变量名 @XXX 已声明。变量名在批查询或存储过程内部必须唯一
- 临时表在存储过程中存放查询结果
- ADO.NET参数化查询时问题, 变量名"@telNum"已声明。变量名在批查询或存储过程内部必须唯一
- Mysql创建存储过程及遍历查询结果