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 ......
Ò»£º
ʹÓÃProfile¶ÔÓû§Session»á»°½øÐÐ×ÊÔ´ÏÞÖÆ
--µ«ÊÇÈç¹ûʹÓÃÁËÁ¬½Ó³ØÖ®ÀàµÄ¶«¶«£¬¾Í»á³öЩÎÊÌ⣬±ÈÈçǰ̨Á¬½Ó²»ÉÏÖ®ÀàµÄ
--http://www.eygle.com/archives/2008/10/profile_session_limit.html
sqlplus "/ as sysdba"
SQL> show parameter resource
SQL> alter system set resource_limit= ......
DML Error Logging in Oracle 10g
Ö÷ÒªÔÚÓÚʹÓÃDBMS_ERRLOG.create_error_log Õâ¸ö°üÀ´¸ú×Ùdml´íÎóÐÅÏ¢
SQL> CREATE TABLE source (
2 id NUMBER(10) NOT NULL,
3 code VARCHAR2(10),
4 description VARCHAR2(50),
5 CONSTRAINT source_pk PRIMARY KEY (id)
6 );
±íÒÑ´´½¨¡£
SQL> DECLARE
2 TYPE t_tab IS ......
×÷Õߣº ÈÕÆÚ£º2005-12-8 1:43:32 À´Ô´£ºInternet µã»÷£º´Î ÆÀÂÛ
¡¡¡¡±¾ÎÄÖ»ÌÖÂÛOracleÖÐ×î³£¼ûµÄË÷Òý£¬¼´ÊÇB-treeË÷Òý¡£±¾ÎÄÖÐÉæ¼°µÄÊý¾Ý¿â°æ±¾ÊÇOracle8i¡£
¡¡¡¡Ò». ²é¿´ÏµÍ³±íÖеÄÓû§Ë÷Òý
¡¡¡¡ÔÚOracleÖУ¬SYSTEM±íÊǰ²×°Êý¾Ý¿âʱ×Ô¶¯½¨Á¢µÄ£¬Ëü°üº¬Êý¾Ý¿âµÄÈ«²¿Êý¾ ......
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
& ......