ORACLE Top/Bottom N、First/Last、NTile
目录
==================================================================
1.带空值的排列
2.Top/Bottom N查询
3.First/Last排名查询
4.按层次查询
一、带空值的排列:
假如被排列的数据中含有空值呢?
SQL> select region_id, customer_id,
2 sum(customer_sales) cust_sales,
3 sum(sum(customer_sales)) over(partition by region_id) ran_total,
4 rank() over(partition by region_id
5 order by sum(customer_sales) desc) rank
6 from user_order
7 group by region_id, customer_id;
REGION_ID CUSTOMER_ID CUST_SALES RAN_TOTAL RANK
---------- ----------- ---------- ---------- ----------
10 31 6238901 1
10 26 1808949 6238901 2
10 27 1322747 6238901 3
10 30 1216858 6238901 4
10 28
相关文档:
oracle表空间操作详解
1
2
3作者: 来源: 更新日期:2006-01-04
5
6
7建立表空间
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
大家好,我在http://download.csdn.net/source/836323上发的帖子,确实只是个demo,其题库内容见下文,此为最新题库的一部分,正式版题库是175题。需要正式版本的朋友,可以直接联系我或者到www.certinside.cn/1z0-051 上面看看,我们和testinside是一家的,需要的话我可以给你打个折,价格再议。我的QQ:390970748 ......
由于系统移植,原来的数据库编码和时区都换了,原来的一些SQL文也出错了。。
经常崩出"ORA-01846: not a valid day of the week
"错误。
经测试,以下这个简单语句也会错!!
SQL> select next_day(sysdate,'FRIDAY') from DUAL;
select next_day(sysdate,'FRIDAY') from DUAL
ORA-01 ......
今天第一次知道ORACLE原来还可以这样INSERT的……长见识了
一、无条件 INSERT ALL
二、条件 INSERT ALL
三、条件 INSERT FIRST
Insert…Select
使用Insert Select实现同时向多个表插入记录
一、无条件 INSERT ALL
----------------------------------------------------------------------- ......
Oracle Process Structure
Oracle takes advantage of various types of processes:
—User process: Started at the time a database user requests connection to the Oracle server
—Server process: Connects to the Oracle instance and is started when a user establishes a session
& ......