declare num integer;
begin
select count(distinct userid) into num from user_info_t t where to_char(regdate,'yyyymm')='200802';select count(distinct userid)/num from mmwarehome.user_log_t
where userid in (select userid from user_info_t t where to_char(regdate,'yyyymm')='200802');
end;
begin
select count(distinct userid) into num from user_info_t t where to_char(regdate,'yyyymm')='200802';select count(distinct userid)/num from mmwarehome.user_log_t
where userid in (select userid from user_info_t t where to_char(regdate,'yyyymm')='200802');
end;
解决方案 »
- sqlplus可以登录,plsql不能登录,卡在登录界面不动,也没有错误提示
- oracle中load用法
- 寻找“dmp文件修改相应字节,改变倒入imp字符集”
- 请教:如何查找、删除表(海量数据)中重复的记录?
- 函数总出pls-00103错误,大家帮个忙.
- 登录独立启动时可以,但登录到Oracl Managerment Server 时就不行!!!
- 请问如何用Oracle建一个数据库,并发布出去,具体点,行吗?
- 备份文件恢复数据库
- NULL与空字符串的问题
- 这道数据库的面试题难道我了
- oracle的存储过程中判断表是否在,在的话insert否则creat(在线等)
- 一个关于存储过程的问题,只能执行一半就跳出了!不知道为什么?大家帮忙看看!
where userid in (select userid from user_info_t t where to_char(regdate,'yyyymm')='200802');
这里少了个INTO
再定义个变量
declare num integer;
declare temp integer; begin
select count(distinct userid) into num from user_info_t t where to_char(regdate,'yyyymm')='200802'; select count(distinct userid)/num into temp from mmwarehome.user_log_t
where userid in (select userid from user_info_t t where to_char(regdate,'yyyymm')='200802');
end;