OracleËø»úÖÆ
ÔÚ´óÐÍÊý¾Ý¿âÖУ¬Ò»·½ÃæÊý¾Ý¿âÒªÌṩ¸ß²¢·¢·ÃÎʵÄÄÜÁ¦£¬ÓÖÒª±£Ö¤Ã¿Ò»¸öÓû§ÒÔÒ»Öµķ½Ê½·ÃÎʺÍÐÞ¸ÄÊý¾Ý¡£Ëø»úÖÆ¾ÍÊÇÓÃÀ´½â¾öÕâÒ»ÎÊÌ⣬ÓÃÓÚ¿ØÖƶԹ²Ïí×ÊÔ´µÄ²¢·¢·ÃÎÊ£¬±£Ö¤Êý¾Ý·ÃÎʵÄÒ»ÖÂÐÔºÍ׼ȷÐÔ¡£
ÔÚoracleÖУ¬¾ßÓÐÈýÖÖÀàÐ͵ÄËø£º
1.DDLËø:ÔÚÖ´ÐÐDDLÓï¾äʱ£¬×Ô¶¯ÉÏDDLËø£¬±£Ö¤±í½á¹¹²»»Ø±»ÆäËü»á»°ÐÞ¸Ä.
2.DMLËø:DMLÓï¾ä¶ÔÓ¦µÄËø£¬ÓÖ·ÖΪTXËøºÍTMËø¡£
3.ãÅ»òÄÚ²¿Ëø
Ïà¹ØÎĵµ£º
Ò»Ö±ÒÔΪ <id name="id" type="integer">
<column name="ID" precision="5" scale="0" />
<generator class="sequence"¡¡/>
</id> ÕâÑù¾Í¿ÉÒÔ×ÔÔöÁË¡£¡£
¿É½ñÌìÔÚ²âÊÔʱ£¬·¢ÏÖ¿ØÖÆÌ¨Ò»Ö±±¨“ÐòÁкŲ»´æÔÚ"µÄ´í¡£¡£¡£ºóÀ´²ÅÖªµÀÔÚsequenceºóà ......
ʹÓÃORDER BY×Ӿ䣬ROWNUMÄÚÖú¯ÊýºÍDBMS_RANDOM°üÖеÄÄÚÖú¯ÊýVALUEÀ´ÊµÏÖ
SQL> select * from
2 (
3 select ename,job
4 from emp
5 order by dbms_random.value()
6 )
7 where rownum<=5;
ENAME JOB
---------- ---------
TURNER SALESMAN
SMITH CLERK
MARTIN SA ......
ROLLUPºÍCUBEÓï¾ä¡£
OracleµÄGROUP
BYÓï¾ä³ýÁË×î»ù±¾µÄÓï·¨Í⣬»¹Ö§³ÖROLLUPºÍCUBEÓï¾ä¡£Èç¹ûÊÇROLLUP(A, B, C)µÄ»°£¬Ê×ÏÈ»á¶Ô(A¡¢B¡¢C)½øÐÐGROUP
BY£¬È»ºó¶Ô(A¡¢B)½øÐÐGROUP BY£¬È»ºóÊÇ(A)½øÐÐGROUP BY£¬×îºó¶ÔÈ«±í½øÐÐGROUP BY²Ù×÷¡£Èç¹ûÊÇGROUP BY
CUBE(A, B, C)£¬ÔòÊ×ÏÈ»á¶Ô(A¡¢B¡¢C)½øÐÐGROUP
BY£¬È»ºóÒÀ´ÎÊÇ(A¡ ......
³£ÒªoracleÊý¾Ý¿â¶¨Ê±µÄ×Ô¶¯Ö´ÐÐһЩ½Å±¾£¬»ò×öÊý¾Ý¿â±¸·Ý£¬»ò×öÊý¾ÝµÄÌáÁ¶£¬»ò×öÊý¾Ý¿âµÄÐÔÄÜÓÅ»¯£¬°üÀ¨Öؽ¨Ë÷ÒýµÈµÈµÄ¹¤×÷,ÕâʱÐèÒªÓõ½Ò»¸öº¯Êýdbms_job.submit£¬À´Íê³ÉOracle¶¨Ê±Æ÷Jobʱ¼äµÄ´¦ÀíÉÏ¡£Ê¹ÓÃdbms_job.submitÕâ¸öº¯Êý£¬ÎÒÃÇÖ»ÐèÒª¿¼ÂÇÁ½¸öÊÂÇ飺°²ÅÅijһÈÎÎñ£¬ºÍ¶¨ÖÆÒ»¸öÖ´ÐÐÈÎÎñµÄʱ¼äµã¡£µ«×îÖØÒªÒ²ÊÇ× ......