Oracle 数据库的查询

Oracle 数据库的查询,第1张

平均是AVG,高于就是>了,

你要的应该是这个,

select edeptno,eename from emp e, (select deptno,avg(sal) avg_sal from emp group by deptno) t

where edeptno=tdeptno and esal > tavg_sal

order by edeptno ;

1、在桌面上找到 计算机,右键管理,点击服务和应用程序,双击服务,找到oracle的四个服务,这里我们只需要启动两个即可。如图

2、点击电脑左下角的开始--运行,输入sqlplus,回车。

3、出现命令窗口,

4、用户名填写scott 回车,密码填写scott,等待几秒。

5、以上就是成功连接上Oracle数据库

6、执行select from v$version ,就会出现如图。完成效果图。

with tmp(c_id,c_name,c_up) as 

(

select 1,'四川省',0 from dual union all

select 2,'河北省',0 from dual union all

select 3,'河南省',0 from dual union all

select 4,'成都市',1 from dual union all

select 5,'绵阳市',1 from dual union all

select 6,'南充市',1 from dual union all

select 7,'双流县',4 from dual union all

select 8,'高新区',4 from dual)

select  from tmp 

where c_up=0 

start with c_name='成都市' 

connect by prior c_up=c_id

select SDID , max(substr(sys_connect_by_path(COPYRIGHTID, '/'),2)) str

from (SELECT SDID , COPYRIGHTID ,

row_number() OVER(PARTITION BY SDID ORDER BY SDID) RN

FROM T_CMS_COPYRIGHT_SD_COPYRIGHT

WHERE SDID='参数') t

start with rn = 1

connect by rn = prior rn + 1 and SDID = prior SDID

group by SDID

以上就是关于Oracle 数据库的查询全部的内容,包括:Oracle 数据库的查询、怎么查看oracle数据库数据、Oracle数据库中怎么查询等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/9643665.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-30
下一篇 2023-04-30

发表评论

登录后才能评论

评论列表(0条)

保存