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
Ïà¹ØÎĵµ£º
Oracle Instant ClientÊÇÃâ°²×°µÄOracle¿Í»§¶Ë£¬ÓÉÓÚËüûÓб»OracleµÄ°²×°³ÌÐòËù·â×°£¬Ê¹Óû§¸üÈÝÒ×Àí½âËüµÄ½á¹¹¡£
Instant Client¼ò½é
ÔÚÆä×îеÄVersion 11.1.0.7.0ÖУ¬°üÀ¨ÏÂÃæµÄ°ü£º
µÚÒ»¡¢»ù±¾°ü¡£
ÓÐÁ½ÖÖ£ºÈ«¹¦ÄÜ°üºÍ¼ò»¯°ü£¬¸ù¾ÝÐèÒªÏÂÔØ¡£
1) Instant Client Package - Basic: All files required ......
½ñÌìÖØÐÂÕûÀíµçÄÔ£¬ÕÒµ½Ò»¸öÎļþ£¬¿´ÁËÏÂÈÕÆÚ£¨2006.11.3£© £¬Å²»Ð¡ÐÄÔÙ¶ªÁË£¬´æµ½ÍøÉÏÀ´É¹É¹¡£
SQL ÓïÑÔ·ÖÀࣺ
1 DDL£¨Êý¾Ý¶¨Òå £©ÓÃÓÚ´´½¨ºÍ¶¨ÒåÊý¾Ý¿â¶ÔÏ󣬲¢ÇÒ½«¶ÔÕâЩ¶ÔÏóµÄ¶¨Òå±£´æÔÚÊý¾Ý×ÖµäÖС£
creat table ´´½¨±í
alter table ÐÞ¸ ......
OracleÈëÃÅÊé¼®ÍƼö
Á´½Ó£ºhttp://www.eygle.com/archives/2006/08/oracle_fundbook_recommand.html
ºÜ¶àÅóÓÑÒªÎÒ°ïæÍƼöÒ»ÏÂOracleµÄÈëÃÅÊé¼®£¬Äܹ»Á˽âOracleµÄ»ù±¾¸ÅÄî¡¢»ù±¾ÖªÊ¶µÄÄÇÖÖ¡£
ÎÒ¾ÍÃâΪÆäÄÑ£¬ÍƼö¼¸±¾¡£
Ê×ÏÈÎÒÏëÇ¿µ÷µÄÒ»µãÊÇ£¬ÈκÎÒ»±¾ÏµÍ³µÄOracleÊé¼®Ö»ÒªÈÏÕæ¶ÁÏÂÀ´£¬¶¼»áÓв»´íµÄÊÕ»ñ£¬¶ÁÊé×î¼É»äµÄ ......
OracleÊý¾Ý¿âÊÇÒ»ÖÖ´óÐ͹ØϵÐ͵ÄÊý¾Ý¿â£¬ÎÒÃÇÖªµÀµ±Ê¹ÓÃÒ»¸öÊý¾Ý¿âʱ£¬½ö½öÄܹ»¿ØÖÆÄÄЩÈË¿ÉÒÔ·ÃÎÊÊý¾Ý¿â£¬ÄÄЩÈ˲»ÄÜ·ÃÎÊÊý¾Ý¿âÊÇÎÞ·¨Âú×ãÊý¾Ý¿â·ÃÎÊ¿ØÖƵġ£DBAÐèҪͨ¹ýÒ»ÖÖ»úÖÆÀ´ÏÞÖÆÓû§¿ÉÒÔ×öʲô£¬²»ÄÜ×öʲô£¬ÕâÔÚOracleÖпÉÒÔͨ¹ýΪÓû§ÉèÖÃȨÏÞÀ´ÊµÏÖ¡£È¨ÏÞ¾ÍÊÇÓû§¿ÉÒÔÖ´ÐÐijÖÖ²Ù×÷µÄȨÀû¡£¶ø½ÇÉ«ÊÇΪÁË·½±ãDBA¹Ü ......
create or replace procedure p //ÓоÍÌæ»»£¬Ã»Óоʹ´½¨
is
cursor c is
select * from emp for update;
begin
for v_emp in c loop
if (v_emp.deptno =10) then
&nb ......