1.表结构:
create table products(product_id int,price double,product_type_id int)
2.关联子查询语句 :
select product_id,avg(price) from products outer where price > (select avg(price) from prodcuts inner
where inner.product_type_id=outer.product_type_id);
对这个关联子查询的执行不是太理解,麻烦高手帮忙分析一下!谢谢!
create table products(product_id int,price double,product_type_id int)
2.关联子查询语句 :
select product_id,avg(price) from products outer where price > (select avg(price) from prodcuts inner
where inner.product_type_id=outer.product_type_id);
对这个关联子查询的执行不是太理解,麻烦高手帮忙分析一下!谢谢!
解决方案 »
- 配置Oracle AS服务后服务起不来!
- 一个关于INSTR的问题
- 请高手写一个SQL,有一个表A,根据某种条件选出若干条记录,其中每一条记录都与另外一个表B中若干条记录相关联,我现在想在A的没一条记录
- shell导出查询结果
- oracle10g的数据如何导入oracle9i中?急
- sql语句的疑惑
- 请高手来分析一下问题!!
- 200分。200分。我的ORACLE8。16安装完毕后。有装了其他软件。再登陆时不成功,显示:凭证检索失败
- 来鸟问题(在线给分)
- 请问,我在unix上用connect internal/oracle联接后,它总是报insufficient privileges,这是为什么?
- ODBC (oracle in oraHome92)连接oracle 11g显示 ORA-01017 登陆被拒绝什么原因?
- 初学提问
group by product_id
having avg(price) > (select avg(price) from prodcuts)
先执行子查询再执行整个查询。
product_id ,price ,product_type_id
是无限延伸的。
product_id 是父ID
product_type_id 是对应的父ID的ID