Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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 


Ïà¹ØÎĵµ£º

DML Error Logging in Oracle 10g

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 ......

¡¾ÊÕ²ØÕûÀí¡¿OracleÊý¾Ý¿âÌåϵ¼Ü¹¹

 Ô­Îļûhttp://blog.csdn.net/kele1121/archive/2009/10/30/4742051.aspxÓëhttp://www.itpub.net/thread-1105403-1-1.html
 Ëùν
Oracle
µÄÌåϵ¼Ü¹¹£¬ÊÇÖ¸
Oracle
Êý¾Ý¿â¹ÜÀíϵͳµÄµÄ×é³É²¿·ÖºÍÕâЩ×é³É²¿·ÖÖ®¼äµÄÏ໥¹Øϵ£¬°üÀ¨
ÄÚ´æ½á¹¹¡¢ºǫ́½ø³Ì¡¢ÎïÀíÓëÂß¼­½á¹¹µÈ¡£
Oracle
Êý¾Ý¿âµÄÌåϵºÜ¸´ÔÓ£¬¸´Ô ......

ORACLE¸ÅÒªÎļþ

¼ÇµÃÒÔÇ°ÉÏOCP¿Î³ÌµÄʱºòÄǸöÀÏʦ½ÌÎÒÃÇʹÓÃPROFILEÀ´ÏÞÖÆÓû§µÄһЩ²Ù×÷£¬ÄǸöʱºò¹À¼ÆÊÇÀÏʦ͵ÀÁ°É£¬ËùÓÐʵÑ鶼ÊÇͨ¹ýOEMµÄÐÎʽÀ´²Ù×÷£¬¸ù±¾²»»áÉæ¼°µ½ÃüÁîÐС£
ƽʱÔÚѧϰORACLEµÄ¹ý³ÌÖкÃÏñÒ²ºÜÉÙÅöµ½¹ØÓÚPROFILEµÄÎÊÌ⣬½ñÌì¹äÒ»¸öÅóÓѵÄBLOGµÄʱºò·¢ÏÖÕâƪÎÄÕ£¬¾õµÃͦºÃµÄ£¬ÄÚÈݲ»¶à£¬¼ò½àÃ÷ÁË£¬ºÃ´õÒ²ËãÊǸöÃüÁîÐÐ ......

ORACLE Rank, Dense_rank, row_number

Ŀ¼
======================================================
1.ʹÓÃrownumΪ¼Ç¼ÅÅÃû
2.ʹÓ÷ÖÎöº¯ÊýÀ´Îª¼Ç¼ÅÅÃû
3.ʹÓ÷ÖÎöº¯ÊýΪ¼Ç¼½øÐзÖ×éÅÅÃû
Ò»¡¢Ê¹ÓÃrownumΪ¼Ç¼ÅÅÃû£º
¡¾1¡¿²âÊÔ»·¾³£º
SQL> desc user_order;
Name              ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ