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

Oracle ·ÖÎöº¯Êý


   ·ÖÎöº¯ÊýÊÇoracle816ÒýÈëµÄÒ»¸öȫеĸÅÄî,ΪÎÒÃÇ·ÖÎöÊý¾ÝÌṩÁËÒ»ÖÖ¼òµ¥¸ßЧµÄ´¦Àí·½Ê½.ÔÚ·ÖÎöº¯Êý³öÏÖÒÔǰ,ÎÒÃDZØÐëʹÓÃ×ÔÁª²éѯ,×Ó²éѯ»òÕßÄÚÁªÊÓͼ,ÉõÖÁ¸´ÔӵĴ洢¹ý³ÌʵÏÖµÄÓï¾ä,ÏÖÔÚÖ»ÒªÒ»Ìõ¼òµ¥µÄsqlÓï¾ä¾Í¿ÉÒÔʵÏÖÁË,¶øÇÒÔÚÖ´ÐÐЧÂÊ·½ÃæÒ²ÓÐÏ൱´óµÄÌá¸ß.
ÏÂÃæÖ÷Òª½éÉÜÒ»ÏÂÒÔϼ¸¸öº¯ÊýµÄʹÓ÷½·¨
1.   Over() ¿ª´°º¯Êý
2.    Nvl()º¯Êý
3.  Rollup,Cube×Ô¶¯»ã×ܺ¯Êý
4.  Rank,Dense_rank,Row_numberº¯Êý
5.  Lag , Leadº¯Êý
6.  Sum,Avg, Count, Maxº¯Êý
7.  Ratio_to_report±¨±í´¦Àíº¯Êý
8.  First,Last£¬First_value£¬Last_valueÈ¡»ùÊýµÄ·ÖÎöº¯Êý
9.   Greatest, Least º¯Êý
10.  Trunc, Round,Decode, Substrº¯Êý
Ò»£® Over() ¿ª´°º¯Êý
Over() ¿ª´°º¯ÊýÊÇOracleµÄ·ÖÎöº¯Êý£¬ÆäÓï·¨ÈçÏ£º
º¯ÊýÃû([ ²ÎÊý ]) over( [ ·ÖÇø×Ó¾ä ] [ ÅÅÐò×Ó¾ä [ »¬¶¯´°¿Ú×Ó¾ä ] ])
·ÖÇø×Ó¾äÀàËÆÓÚ¾Û×麯ÊýËùÐèÒªµÄgroup by£¬ÅÅÐò×Ó¾ä¿É¿´³ÉÊÇSQLÓï¾äÖеÄorder by£¬Ö»²»¹ýÔÚ´ËÓï¾äÖл¹¿ÉÖ¸¶¨nullÖµÅÅǰ£¨nulls first£©»¹ÊÇÅźó£¨nulls last£©¡£
¿ª´°º¯ÊýÖ¸¶¨ÁË·ÖÎöº¯Êý¹¤×÷µÄÊý¾Ý´°¿Ú´óС£¬Õâ¸öÊý¾Ý´°¿Ú´óС¿ÉÄÜ»áËæ×ÅÐеı仯¶ø±ä»¯£¬¾ÙÀýÈçÏ£º
over£¨order by salary£© °´ÕÕsalaryÅÅÐò½øÐÐÀۼƣ¬order byÊǸöĬÈϵĿª´°º¯Êý
over£¨partition by deptno£©°´ÕÕ²¿ÃÅ·ÖÇø
over£¨order by salary range between 50 preceding and 150 following£©
ÿÐжÔÓ¦µÄÊý¾Ý´°¿ÚÊÇ֮ǰÐзù¶ÈÖµ²»³¬¹ý50£¬Ö®ºóÐзù¶ÈÖµ²»³¬¹ý150
over£¨order by salary rows between 50 preceding and 150 following£©
ÿÐжÔÓ¦µÄÊý¾Ý´°¿ÚÊÇ֮ǰ50ÐУ¬Ö®ºó150ÐÐ
over£¨order by salary rows between unbounded preceding and unbounded following£©
ÿÐжÔÓ¦µÄÊý¾Ý´°¿ÚÊÇ´ÓµÚÒ»Ðе½×îºóÒ»ÐУ¬µÈЧ£º
over£¨order by salary range between unbounded preceding&n


Ïà¹ØÎĵµ£º

dzÎöOracle¼àÌýÆ÷°²×°ÓëÅäÖÃ

2009-04-22 22:00
À´Ô´£ºÖйú
IT
ʵÑé
ÊÒ ×÷ÕߣºØýÃû
 
Oracle
¿Í
»§
¶ËÓë·þ
Îñ
Æ÷¶ËµÄ
Á¬
½ÓÊÇͨ
¹ý
¿Í
»§
¶Ë
·¢
³ö
Á¬
½Ó
Çë
Çó£¬ÓÉ·þ
Îñ
Æ÷¶Ë
¼à
ÌýÆ÷
¶Ô
¿Í
»§
¶Ë
Á¬
½Ó
Çë
Çó
½ø
ÐкϷ¨
¼ì²é
£¬Èç¹û
Á¬
½Ó
Çë
ÇóÓÐЧ£¬
Ôò½ø
ÐÐ
Á¬
½Ó£¬·ñ
Ôò
¾Ü
¾ø¸ÃÁ¬
½Ó¡£ ......

oracle ÐèҪעÒâµÄµØ·½

INSERT /*+APPEND */ INTO employee (empno,ename,sal,deptno)
SELECT empno,ename,sal,deptno from emp
WHERE deptno=20;
µÚ¶þÌõÓï¾äʹÓÃ/*+APPEND */À´±íʾ²ÉÓÃÖ±½Ó×°ÔØ·½Ê½£¬µ±Òª×°ÔØ´óÅúÁ¿Êý¾Ýʱ£¬²ÉÓõڶþÖÖ·½·¨×°ÔØÊý¾ÝµÄËÙ¶ÈÒªÔ¶Ô¶ÓÅÓÚµÚÒ»ÖÖ·½·¨¡£
ʹÓöà±í²åÈëÊý¾Ý
ʹÓÃALL²Ù×÷·ûÖ´Ðжà±í²åÈëʱ£¬ÔÚÿ¸öÌõ¼þ× ......

WindowsXPÏÂORACLE 10g°²×°Óë²Ù×÷ͼ½â

 ³ö´¦£ºhttp://hi.baidu.com/vcy168/blog/item/877945d908c3d52611df9ba0.html
WindowsÏÂORACLE 10g°²×°Óë²Ù×÷ͼ½â
¸Õ¸Õ½Ó´¥ORACLEµÄÈËÀ´Ëµ,´ÓÄÇÀïѧ,ÈçºÎѧ,ÓÐÄÇЩ¹¤¾ß¿ÉÒÔʹÓÃ,Ó¦¸ÃÖ´ÐÐʲô²Ù×÷,Ò»¶¨»Ø¸Ðµ½ÎÞÖú¡£ËùÒÔÔÚѧϰʹÓÃORACLE֮ǰ£¬Ê×ÏÈÀ´°²×°Ò»ÏÂORACLE 10g£¬ÔÚÀ´ÕÆÎÕÆä»ù±¾¹¤¾ß¡£Ë×»°ËµµÄºÃ£º¹¤ÓûÉÆÆäÊ ......

ORACLE º¯Êý¼¯½õ

Ò»¡¢ ³£ÓÃÈÕÆÚÊý¾Ý¸ñʽ
1.Y»òYY»òYYY ÄêµÄ×îºóһ룬Á½Î»»òÈýλ
SQL> Select to_char(sysdate,'Y') from dual;
TO_CHAR(SYSDATE,'Y')
--------------------
7
SQL> Select to_char(sysdate,'YY') from dual;
TO_CHAR(SYSDATE,'YY')
---------------------
07
SQL> Select to_char(sysdate,'YYY') from ......

¹ØÓÚORACLEÊý¾Ý¿âÖÐȨÏ޺ͽÇÉ«µÄ̽Ë÷

OracleÊý¾Ý¿âÊÇÒ»ÖÖ´óÐ͹ØÏµÐ͵ÄÊý¾Ý¿â£¬ÎÒÃÇÖªµÀµ±Ê¹ÓÃÒ»¸öÊý¾Ý¿âʱ£¬½ö½öÄܹ»¿ØÖÆÄÄЩÈË¿ÉÒÔ·ÃÎÊÊý¾Ý¿â£¬ÄÄЩÈ˲»ÄÜ·ÃÎÊÊý¾Ý¿âÊÇÎÞ·¨Âú×ãÊý¾Ý¿â·ÃÎÊ¿ØÖƵġ£DBAÐèҪͨ¹ýÒ»ÖÖ»úÖÆÀ´ÏÞÖÆÓû§¿ÉÒÔ×öʲô£¬²»ÄÜ×öʲô£¬ÕâÔÚOracleÖпÉÒÔͨ¹ýΪÓû§ÉèÖÃȨÏÞÀ´ÊµÏÖ¡£È¨ÏÞ¾ÍÊÇÓû§¿ÉÒÔÖ´ÐÐijÖÖ²Ù×÷µÄȨÀû¡£¶ø½ÇÉ«ÊÇΪÁË·½±ãDBA¹Ü ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ