我建了个存储过程 sp_CURSOR1
运行正确
当我在游标中使用sp_CURSOR1时
提示 对象名 'sp_CURSOR1' 无效。
怎么回事? 游标对存储过程不行吗?
游标源码如下:
declare gao_ok scroll cursor
for
select * from sp_CURSOR1 order by sno
for read only
open gao_ok
dec ......
我想做这样一个存储过程功能:Oracle中通过输入一个条件查询一条数据,没有此数据则做操作1,有此数据则做操作2
代码:
create or replace procedure test(studentid)
....
select * from student where sid=studentid
if sql%count=1 then
begin
操作1
......
ntime 数据库中时间字段 格式为 2009-02-03
etime=date()
select * from Orders where fgs='哈尔滨' and (ntime - 2009-11-11 > 3) order by id desc
我想计算 当前时间 减去 数据中时间 大于 3个月的显示
Microsoft OLE DB Provider for SQL Server 错误 '8004 ......
表 table_a
name money id
张三 100 1
张三 200 2
张三 300 3
李四 100 4
李四 120 5
王五 30 6
用一SQL语句得出以下结果,取出每个name中id最大的记录 ......
如何用sql语句查询 id=xx 的上一条记录和下一条记录
在线等 比较着急
id authorid
1 1111
2 2222
3 1111
4 3333
5 4444
6 1111
7 5555
我能获得的条件是id=3 authorid=1111 如何查询id=6这条数据 也就是id=3 authorid=1111的下一条数据
......
怎么用啊?查询分析器都找不到..555
楼主别急慢慢来。刚接触新软件都这样……
看着界面偏左上那里有一个按钮是“新建查询” 然后选择连接 就可以了
查询分析器,你点开就提示连接,默认是LOCAL直接连接呀,然后选择数据库,写查询呀
打开
SQL SERVER MANAGEMENT STUDIO
开始菜单的 Microsoft SQL ......