解决方案 »
- linux oracle 新手,安装问题请教
- alter table abc add column c varchar(10);
- Oracle9i重新编译包时,发生内部错误
- BCNF分解 各位帮忙!!!!!!!!!!
- 很多面试试题都有这样一道题,就是写个SQL语句,输出表中第M条数据到第N条数据,这是考什么啊?
- 想存入数量不等的图象文件,给如何设计数据库?
- ===如何将oracle的字符集设定为UTF-8,还是oracle只能一个字符集,比如,简体中文,繁体中文等等====
- 在Oracle9中如何建立一个方案?我建完一个用户之后,怎么在方案中看不到?
- 我有两个装了win2000 专业版与服务器版操作系统的机器,why oracle(client or server)不能装?双击安装图标没提示也没反应?
- 数据链路同义词奇怪的问题 (在线等待) 请各位高手快快帮忙!!!!!!!!!!
- 有个oracle查询的问题
- Rac双节点Oracle数据库的远程访问
select customer1.f_key form gr_p_customer customer1
where customer1.f_status = '2' and customer1.f_usesign = '0' and customer1.f_branch = '123123123123123' and
(select f_taskgoing from
(select task3.f_taskgoing from gr_c_task task3 where task3.f_customer = customer1.f_key order by task3.f_insettime desc)
where rownum<=1
)
in ('3',)失效?不大明白LZ的意思是第一句里面customer1.f_key查不到数据还是?and和in中间的查询返回的值是对的吧 ?
对不起啊,不知道为什么不能编辑自己的帖子。黄色部分是我开始写的 我以为颜色会出来 但是没出来就是第二个子查询的 customer1.f_key 标识符失效
嗯 这个肯定会失效呢 嵌套2层了 customer1这个在里面不能被识别出来
where customer1.f_status = '2' and customer1.f_usesign = '0' and customer1.f_branch = '123123123123123' and
(select f_taskgoing from
(select task3.f_taskgoing,t1.f_key
from gr_c_task task3 ,gr_p_customer t1
where task3.f_customer = f_key
order by task3.f_insettime desc) t2
where rownum<=1 and customer1.f_key=t2.f_key
)
in ('3',)
会提示红色部分ORA-00923: 未找到要求的 FROM 关键字
我的问题 from 写错了。SQL能运行成功 我看看能不能符合业务要求 谢谢。
还真没注意 LZ 你的sql中from都写错了 你写成form 了
嘿嘿。SQL是这样的 这样就能运行成功了。 但是有个问题。
现在库里 customer表里有600万数据,Task表里有700万数据
所以不得不考虑效率问题
您看看还有什么能优化的地方么。。感激不尽。。
这条SQL是框架 buffer.Append()拼出来的,我跟踪出来的。
应该不能联合查询。
http://stackoverflow.com/questions/2048244/oracle-subquery-does-not-see-the-variable-from-the-outer-block-2-levels-up这里面的解决方法好像跟您的一样。 至于优化问题 我再想想。感谢感谢感谢。