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

Oracle´´½¨ÐòÁÐ sequence


OracleÖеÄÐòÁкŹËÃû˼Òå¾ÍÊÇ´´½¨Ò»¸öÐòÁкţ¬¿ÉÒÔÔÚ²åÈë»òÕ߸üеÄʱºòµ÷Óã¬Ï൱ÓÚÊÇÒ»¸öÉú³ÉÆ÷
´´½¨Óï·¨£º
create sequence myse
increment by 1       --Ôö³¤¶È
start with
1         --´ÓÄÄÀïÔö¼Ó£¬¾ÍÊÇ˵ÏÂÒ»¸ö»ñÈ¡µÄÖµ´ÓÕâ¸öÖµ¿ªÊ¼
nomaxvalue           --²»ÉèÖÃ×î´óÖµ  
¶ÔÓ¦µÄ£ºmaxvalue  30¡¢
order                --Ö¸¶¨Ò»¶¨ÍùÏÂÔö¼Ó
nocycle             
--²»Ñ­»·£¬CYCLEºÍNOCYCLE ±íʾµ±ÐòÁÐÉú³ÉÆ÷µÄÖµ´ïµ½ÏÞÖÆÖµºóÊÇ·ñÑ­»·
cache  10          
--CACHE(»º³å)¶¨Òå´æ·ÅÐòÁеÄÄÚ´æ¿éµÄ´óС£¬Ä¬ÈÏΪ20¡£NOCACHE±íʾ²»¶ÔÐòÁнøÐÐÄڴ滺³å¡£¶ÔÐòÁнøÐÐÄڴ滺³å£¬¿ÉÒÔ¸ÄÉÆÐòÁеÄÐÔÄÜ
Ð޸ģº
ÐòÁеÄijЩ²¿·ÖÒ²¿ÉÒÔÔÚʹÓÃÖнøÐÐÐ޸쬵«²»ÄÜÐÞ¸ÄSATRT
WITHÑ¡Ïî¡£¶ÔÐòÁеÄÐÞ¸ÄÖ»Ó°ÏìËæºó²úÉúµÄÐòºÅ£¬ÒѾ­²úÉúµÄÐòºÅ²»±ä¡£ÐÞ¸ÄÐòÁеÄÓï·¨ÈçÏ£º
ALTER SEQUENCE emp_sequence
INCREMENT BY 10
MAXVALUE 10000
CYCLE -- µ½10000ºó´ÓÍ·¿ªÊ¼
NOCACHE ;
Ðè×¢Ò⣺
µÚÒ»´ÎNEXTVAL·µ»ØµÄÊdzõʼֵ£»ËæºóµÄNEXTVAL»á×Ô¶¯Ôö¼ÓÄ㶨ÒåµÄINCREMENT
BYÖµ£¬È»ºó·µ»ØÔö¼ÓºóµÄÖµ¡£CURRVAL
×ÜÊÇ·µ»Øµ±Ç°SEQUENCEµÄÖµ£¬µ«ÊÇÔÚµÚÒ»´ÎNEXTVAL³õʼ»¯Ö®ºó²ÅÄÜʹÓÃCURRVAL£¬·ñÔò»á³ö´í¡£Ò»´ÎNEXTVAL»áÔö¼ÓÒ»´ÎSEQUENCEµÄÖµ£¬ËùÒÔÈç¹ûÄãÔÚͬһ¸öÓï¾äÀïÃæÊ¹Óöà¸öNEXTVAL£¬ÆäÖµ¾ÍÊDz»Ò»ÑùµÄ¡£
ɾ³ý£º
DROP SEQUENCE order_seq;
< type="text/javascript">
< type="text/javascript">


Ïà¹ØÎĵµ£º

oracleǶÌ×

Ò»¡¢Ç¶Ì×±íµÄ¶¨Ò壺
    ǶÌ×±íÊDZíÖÐÖ®±í¡£Ò»¸öǶÌ×±íÊÇijЩÐеļ¯ºÏ£¬ËüÔÚÖ÷±íÖбíʾΪÆäÖеÄÒ»ÁС£¶ÔÖ÷±íÖеÄÿһÌõ¼Ç¼£¬Ç¶Ì×±í¿ÉÒÔ°üº¬¶à¸öÐС£ÔÚijÖÖÒâÒåÉÏ£¬ËüÊÇÔÚÒ»¸ö±íÖд洢һ¶Ô¶à¹ØÏµµÄÒ»ÖÖ·½·¨¡£¿¼²éÒ»¸ö°üº¬²¿ÃÅÐÅÏ¢µÄ±í£¬ÔÚÈκÎʱ¼äÄÚÿ¸ö²¿ÃÅ»áÓкܶàÏîÄ¿ÕýÔÚʵʩ¡£ÔÚÒ»¸öÑϸñµÄ¹ØÏµÄ£ÐÍÖУ ......

Oracle Decodeº¯ÊýʹÓü¼ÇÉ


decodeº¯Êý
Óï·¨£º
decode(expr,search,result[,search,result]..[,search,result][,default])
½âÊÍ£º
±È½ÏexprÓëÿ¸ösearchµÄÖµ£¬Èç¹ûexprµÈÓÚij¸ösearch£¬Ôò·µ»ØÏàÓ¦µÄresult£»Èç¹ûûÓÐÆ¥ÅäµÄÖµ£¬Ôò·µ»ØdefaultÖµ£»Èç¹ûûÓÐÖ¸¶¨defaultÖµ£¬Ôò·µ»Ønull
×¢Ò⣺
±È½Ïǰ£¬Oracle×Ô¶¯½«exprµÄÊý¾ÝÀàÐÍת»»³ÉµÚÒ»¸ösear ......

´«ÖDz¥¿Í——Êý¾Ý¿âÖ®ORACLE£¨Ò»£©


Ò» Oracle¹«Ë¾¼ò½é 
OracleÊÇÒóÐæ³öÍÁµÄ¼×¹ÇÎÄ(oracle bone inscriptions)µÄÓ¢ÎÄ·­ÒëµÄµÚÒ»¸öµ¥´Ê
Oracle¹«Ë¾ÊÇÈ«Çò×î´óµÄÐÅÏ¢¹ÜÀíÈí¼þ¼°·þÎñ¹©Ó¦ÉÌ£¬³ÉÁ¢ÓÚ1977Ä꣬×ܲ¿Î»ÓÚÃÀ¹ú¼ÓÖÝ Redwood shore
Oracle¹«Ë¾ÒòÆä¸´ÔӵĹØÏµÊý¾Ý¿â²úÆ·¶øÎÅÃû¡£OracleµÄ¹ØÏµÊý¾Ý¿âÊÇÊÀ½çµÚÒ»¸öÖ§³ÖSQLÓïÑÔµÄÊý¾Ý¿â
OracleÔÚ³¬¹ý ......

Oracleά»¤³£ÓÃSQLÓï¾ä»ã×Ü

Oracleά»¤³£ÓÃSQLÓï¾ä»ã×Ü
ÉÏһƪ / ÏÂһƪ  2008-09-04 11:25:01
²é¿´( 1991 ) / ÆÀÂÛ( 0 ) / ÆÀ·Ö( 0 / 0 )
ÈçºÎÔ¶³ÌÅжÏOracleÊý¾Ý¿âµÄ°²×°Æ½Ì¨
select * from v$version;
²é¿´±í¿Õ¼äµÄʹÓÃÇé¿ö
select sum(bytes)/(1024*1024) as free_space,tablespace_name
from dba_free_space
group by tablespace_ ......

Oracle Connect ByÓ÷¨

Oracle Connect ByÓ÷¨
 
oracleÖеÄselectÓï¾ä¿ÉÒÔÓÃSTART WITH...CONNECT BY PRIOR×Ó¾äʵÏֵݹé²éѯ£¬connect by Êǽṹ»¯²éѯÖÐÓõ½µÄ£¬Æä»ù±¾Óï·¨ÊÇ£º
select ... from <TableName>
where <Conditional-1>
start with <Conditional-2>
connect by <Conditional-3>
;
<Conditi ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ