- 浏览: 60495 次
- 来自: 上海
最新评论
问题一:获取SCOTT用户中EMP表里最早入职的前五名雇员?
SQL> select top 5 * from emp order by hiredate asc;
SQL Server中的写法,不适用于Oracle数据库。
下面也是错误的写法
SQL> select rownum,empno,ename,hiredate from emp 2 where rownum<6 3 order by hiredate asc;
正确的写法:
使用了内嵌视图,构造中间的临时查询结果,在这个结果基础上,使用rownum处理
1 select empno,ename,hiredate from (select empno,ename,hiredate from emp 2 order by hiredate asc) 3* where rownum<6 SQL> /
问题二:获取SCOTT用户中EMP表里最早入职的 第 五 名 雇员?
1 select empno,ename,hiredate from 2 (select empno,ename,hiredate from 3 (select empno,ename,hiredate from (select empno,ename,hiredate from emp 4 order by hiredate asc) 5 where rownum<6) order by hiredate desc) 6* where rownum<2 SQL> /
发表评论
文章已被作者锁定,不允许评论。
-
ORACLE日期时间处理
2013-01-25 17:56 1238--感觉ORACLE对日期的处理比MS较方便些 --修改会 ... -
AutoTrace执行结果说明
2013-01-25 14:11 789统计信息 --------------- ... -
闪回数据库技术
2011-11-25 08:51 1143SQL> conn / as sysdba;已连接 ... -
触发器实例
2011-11-24 09:16 1061create or replace trigger u ... -
包实例
2011-11-24 09:16 750SQL> col object_name f ... -
存储过程、函数简单应用
2011-11-24 09:16 974create or replace procedure ... -
ORACLE体系结构
2011-11-24 09:15 822001、oracle体系结构: oracle产品和 ... -
游标简单操作
2011-11-25 08:50 1203--显示游标 处理检索多行数据 --whil ... -
数据泵导出导入(SCHEMAS)
2011-11-25 08:51 8530一、导出 1、 cmd-->C:\Docume ... -
PLSQL developer连接oracle
2011-11-25 08:50 998装好ORACLE 10g后,安装plsql ... -
ORACLE安装前后
2011-11-24 09:17 830安装前:计算机名必须小于8位(不能以数字开 ... -
数据库事务
2011-11-22 11:24 894查看数据库默认隔离级别: 查看InnoDB系统级别 ... -
导入TXT文件与导出TXT
2011-11-28 10:05 1016导入.TXT文件与导出*. ... -
加载数据
2011-11-28 10:05 8581、使用LOAD DATA语句要比INSERT语句的加载 ... -
字符串连接
2011-11-28 10:05 822mysql> select 'abc'+'123' ... -
DELETE语法
2011-11-28 10:06 1606仅仅在 FROM 或 USING 子句之前列出的表中的匹 ... -
复制表
2011-11-22 11:24 760创建测试表test:mysql> create tabl ... -
定时执行存储过程
2011-11-18 22:46 974存储过程学习:http://www.111 ... -
计算机localhost在网络上不存在
2011-11-22 11:22 990计算机localhost在网络上不存在——数据库 ... -
EXPLAIN语法
2011-11-29 09:09 891EXPLAIN table == DESC table ...
相关推荐
Plane answers to complex questions-The Theory of Linear Models, by Ronald Christensen. The 3 edition.
"Coding Interview Questions" is a book that presents interview questions in simple and straightforward manner with a clear-cut explanation. This book will provide an introduction to the basics. It ...
Frequently Asked Questions for FreeBSD.pdf
Asking the right questions.pdf
问题背后的问题,Questions Behind Questions,描述发现更深层的问题,提高工作效率,发挥自己的能动性。
Data Structures & Algorithms Interview Questions You'll Most Likely Be Asked 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
汉化文件 redmine questions Q
interview questions answers
A collection of System Design Interview Questions.
Ask questions Get sales 2nd version. Close the deal and create long-term relationships
fresh questions from interviews of Bloomberg, Microsoft, Amazon, Citigroup and other big firms, good material to prepare for interview
VMware 2V0-21.20 Exam Actual Questions
Questions, Answers & Explanations Table of Contents Introduction Welcome CISSP Exam Overview Practice Exams and Quizzes CISSP Mock Exam (Baseline) CISSP Mock Exam (LITE) - 1 Domain Area Test: Security...
AWS Interview Questions
Oracle Interview Questions
SAP MM Certification Questions, Answers, and Explanations
2015年AP微积分BCfree-response-questions[归纳].pdf
Chapter titles include: The Benefit of Asking the Right Questions; What are the Issue and the Conclusion?; What Are the Reasons?; What Are the Value Conflicts and Assumptions?; Are There Any ...
DOCKER-INTERVIEW-QUESTIONS.pdf