很简单的oracle问题谁帮我看看

好奇都是要学的 2012-03-02 05:22:22
declare
varSql int;
begin
varSql:=0;
select b.e_perlevel into varSql from E_USERS a
left join E_PERSON b on a.u_personid=b.id where a.id=1847;

select id,e_pername from E_PERSON where e_perlevel>varSql;
end;

我这个就是开个查询分析器写的 想通过ID 取 这个人的级别给 变量varSql ,然后再取大于这个变量varSql的数据集,按F8一执行,就提示 在此select中缺少into语句。 我才用oracle,以前一直写SQL 。 SQL里是没问题的
...全文
149 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
我写int 没有提示错误
我是睡 2012-03-05
  • 打赏
  • 举报
回复
varSql int;

弱弱的问下,oracle 中有int类型
xiaobluesky 2012-03-02
  • 打赏
  • 举报
回复
PLSQL里面是不可以直接用SELECT 查询语句的 。。
你可以先建张临时表,然后把你要查的记录插进去

insert into xxx
select * from xxx.
you896 2012-03-02
  • 打赏
  • 举报
回复
select id, e_pername
from E_PERSON
where e_perlevel > (select b.e_perlevel
from E_USERS a
left join E_PERSON b
on a.u_personid = b.id
where a.id = 1847);
  • 打赏
  • 举报
回复
那我的想法想实现 不用存储过程行不
  • 打赏
  • 举报
回复
自己顶下。 有人来没啊
xpingping 2012-03-02
  • 打赏
  • 举报
回复
oracle 的过程中
不能是单纯的select
select id,e_pername from E_PERSON where e_perlevel>varSql;

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧