oracle10G·ÖÇøµÄ´´½¨Óëά»¤Oracle·ÖÇø±íºÍ±¾µØË÷Òý
¡¡¡¡OracleµÄ·ÖÇø¼¼ÊõÔÚijЩÌõ¼þÏ¿ÉÒÔ¼«´óµÄÌá¸ß²éѯµÄÐÔÄÜ£¬ËùÒÔ±»¹ã·º²ÉÓᣴӲúÆ·ÉÏ˵£¬·ÖÇø¼¼ÊõÊÇOracleÆóÒµ°æÖжÀÁ¢ÊշѵÄÒ»¸ö×é¼þ¡£ÒÔÏÂÊǶÔÓÚ·ÖÇø¼°±¾µØË÷ÒýµÄÒ»¸öʾÀý¡£
¡¡¡¡OracleµÄ·ÖÇø¼¼ÊõÔÚijЩÌõ¼þÏ¿ÉÒÔ¼«´óµÄÌá¸ß²éѯµÄÐÔÄÜ£¬ËùÒÔ±»¹ã·º²ÉÓᣴӲúÆ·ÉÏ˵£¬·ÖÇø¼¼ÊõÊÇOracleÆóÒµ°æÖжÀÁ¢ÊշѵÄÒ»¸ö×é¼þ¡£ÒÔÏÂÊǶÔÓÚ·ÖÇø¼°±¾µØË÷ÒýµÄÒ»¸öʾÀý¡£
¡¡¡¡Ê×Ïȸù¾Ý×Öµä±í´´½¨Ò»¸ö²âÊÔ·ÖÇø±í£º
SQL> connect eygle/eygle
¡¡¡¡Connected.
¡¡¡¡SQL> CREATE TABLE dbobjs
¡¡¡¡2 (OBJECT_ID NUMBER NOT NULL,
¡¡¡¡3 OBJECT_NAME varchar2(128),
¡¡¡¡4 CREATED DATE NOT NULL
¡¡¡¡5 )
¡¡¡¡6 PARTITION BY RANGE (CREATED)
¡¡¡¡7 (PARTITION dbobjs_06 VALUES LESS THAN (TO_DATE('01/01/2007', 'DD/MM/YYYY')),
¡¡¡¡8 PARTITION dbobjs_07 VALUES LESS THAN (TO_DATE('01/01/2008', 'DD/MM/YYYY')));
¡¡¡¡Table created.
¡¡¡¡SQL> COL segment_name for a20
¡¡¡¡SQL> COL PARTITION_NAME for a20
¡¡¡¡SQL> SELECT segment_name, partition_name, tablespace_name
¡¡¡¡2 from dba_segments
¡¡¡¡3 WHERE segment_name = 'DBOBJS';
¡¡¡¡SEGMENT_NAME PARTITION_NAME TABLESPACE_NAME
¡¡¡¡-------------------- -------------------- ------------------------------
¡¡¡¡DBOBJS DBOBJS_06 EYGLE
¡¡¡¡DBOBJS DBOBJS_07 EYGLE
¡¡¡¡´´½¨Ò»¸öLocalË÷Òý£¬×¢ÒâÕâÀï¿ÉÒÔ½«²»Í¬·ÖÇøµÄË÷ÒýÖ¸¶¨´´½¨µ½²»Í¬µÄ±í¿Õ¼ä£º
SQL> CREATE INDEX dbobjs_idx ON dbobjs (created) LOCAL
¡¡¡¡2 (PARTITION dbobjs_06 TABLESPACE users,
¡¡¡¡3 PARTITION dbobjs_07 TABLESPACE users
¡¡¡¡4 );&nbs
Ïà¹ØÎĵµ£º
ROLLUP£¬ÊÇGROUP BY×Ó¾äµÄÒ»ÖÖÀ©Õ¹£¬¿ÉÒÔΪÿ¸ö·Ö×é·µ»ØС¼Æ¼Ç¼ÒÔ¼°ÎªËùÓзÖ×é·µ»Ø×ܼƼǼ¡£
CUBE£¬Ò²ÊÇGROUP BY×Ó¾äµÄÒ»ÖÖÀ©Õ¹£¬¿ÉÒÔ·µ»Øÿһ¸öÁÐ×éºÏµÄС¼Æ¼Ç¼£¬Í¬Ê±ÔÚĩβ¼ÓÉÏ×ܼƼǼ¡£
ÔÚÎÄÕµÄ×îºó¸½ÉÏÁËÏà¹Ø±íºÍ¼Ç¼´´½¨µÄ½Å±¾¡£
1¡¢ÏòROLLUP´«µÝÒ»ÁÐ
SQL> select division_id,sum(salary)
2  ......
¿ÉÒÔʹÓÃGROUPING_IDº¯Êý½èÖúHAVING×Ó¾ä¶Ô¼Ç¼½øÐйýÂË£¬½«²»°üº¬Ð¡¼Æ»òÕß×ܼƵļǼ³ýÈ¥¡£GROUPING_ID()º¯Êý¿ÉÒÔ½ÓÊÜÒ»Áлò¶àÁУ¬·µ»ØGROUPINGλÏòÁ¿µÄÊ®½øÖÆÖµ¡£GROUPINGλÏòÁ¿µÄ¼ÆËã·½·¨Êǽ«°´ÕÕ˳Ðò¶ÔÿһÁе÷ÓÃGROUPINGº¯ÊýµÄ½á¹û×éºÏÆðÀ´¡£
¹ØÓÚGROUPINGº¯ÊýµÄʹÓ÷½·¨¿ÉÒԲμûÎÒÇ°ÃæдµÄһƪÎÄÕÂ
http://blog.csdn ......
1£®Êýѧº¯Êý
¢Ù¾ø¶ÔÖµ
l S£ºselect abs(-1) value
l O£ºselect abs(-1) value from dual
¢ÚÈ¡Õû(´ó)
l S£ºselect ceiling(-001) value
l O£ºselect ceil(-001) value from dual
¢ÛÈ¡Õû£¨Ð¡£©
l S£ºselect floor(-001) value  ......
1. ÒýÑÔ
2. ´¥·¢Æ÷µÄ¸ÅÄîºÍÀàÐÍ
´¥·¢Æ÷ÊÇÒ»ÖÖÌØÊâµÄ´æ´¢¹ý³Ì£¬ËüÔÚ²åÈ룬ɾ³ý»òÐÞ¸ÄÌض¨±íÖеÄÊý¾Ýʱ´¥·¢Ö´ÐУ¬Ëü±ÈÊý¾Ý¿â±¾Éí±ê×¼µÄ¹¦ÄÜÓиü¾«Ï¸ºÍ¸ü¸´ÔÓµÄÊý¾Ý¿ØÖÆÄÜÁ¦¡£Êý¾Ý¿â´¥·¢Æ÷ÓÐÒÔϵÄ×÷Óãº
* °²È«ÐÔ¡£¿ÉÒÔ»ùÓÚÊý¾Ý¿âµÄÖµ ......
ÏÂÎçÈ¥²Î¼ÓÒ»¸öOracleÓйغ£Á¿Êý¾Ý´æ´¢¼¼ÊõµÄÅàѵ½²×ùÁË¡£
µØÖ·ÔÚ¹ãÖÝÊÐÁÖºÍÎ÷·101ºÅÌìºÓÇø¼Æ¾´óÂ¥Î÷²àÈýÂ¥¡£
Åàѵ·¢Æð»ú¹¹Îª£º¹ãÖÝÖÐî£ÐÅÏ¢¼¼ÊõÓÐÏÞ¹«Ë¾¡£
ÏÂÃæ¾Í¼òÒª×ܽáÒ»ÏÂËùÌýµ½µÄһЩ¶«Î÷£¬Ò²ËãÊÇѧµ½µÄÕâЩ¼¼Êõ¡£²»¹ýÓеĶ«Î÷²»ÖªµÀ×ܽáµÄ¶Ô²»¶Ô£¬ÔÝÇÒàñàðÍÌÔæ°É¡£
OracleµÄ´æ´¢¼¼Êõ
´óÌåÉÏ· ......