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

oracle ³£Ó÷ÖÎöº¯Êý

Oracle³£Ó÷ÖÎöº¯Êý
ROW_NUMBER
·µ»ØÓÐÐò×éÖÐÒ»ÐеÄÆ«ÒÆÁ¿£¬´Ó¶ø¿ÉÓÃÓÚ°´Ìض¨±ê×¼ÅÅÐòµÄÐкÅ
row_number() over(partition by ... order by ...)
RANK
¸ù¾ÝORDER BY×Ó¾äÖбí´ïʽµÄÖµ£¬´Ó²éѯ·µ»ØµÄÿһÐУ¬¼ÆËãËüÃÇÓëÆäËüÐеÄÏà¶ÔλÖá£×éÄÚµÄÊý¾Ý°´ORDER BY×Ó¾äÅÅÐò£¬È»ºó¸øÿһÐи³Ò»¸öºÅ£¬´Ó¶øÐγÉÒ»¸öÐòÁУ¬¸ÃÐòÁдÓ1¿ªÊ¼£¬ÍùºóÀÛ¼Ó¡£Ã¿´ÎORDER BY±í´ïʽµÄÖµ·¢Éú±ä»¯Ê±£¬¸ÃÐòÁÐÒ²ËæÖ®Ôö¼Ó¡£ÓÐͬÑùÖµµÄÐеõ½Í¬ÑùµÄÊý×ÖÐòºÅ£¨ÈÏΪnullʱÏàµÈµÄ£©¡£È»¶ø£¬Èç¹ûÁ½ÐеÄÈ·µÃµ½Í¬ÑùµÄÅÅÐò£¬ÔòÐòÊý½«ËæºóÌøÔ¾¡£ÈôÁ½ÐÐÐòÊýΪ1£¬ÔòûÓÐÐòÊý2£¬ÐòÁн«¸ø×éÖеÄÏÂÒ»ÐзÖÅäÖµ3£¬DENSE_RANKÔòûÓÐÈκÎÌøÔ¾
rank() over(partition by ... order by ...)
DENSE_RANK
¸ù¾ÝORDER BY×Ó¾äÖбí´ïʽµÄÖµ£¬´Ó²éѯ·µ»ØµÄÿһÐУ¬¼ÆËãËüÃÇÓëÆäËüÐеÄÏà¶ÔλÖá£×éÄÚµÄÊý¾Ý°´ORDER BY×Ó¾äÅÅÐò£¬È»ºó¸øÿһÐи³Ò»¸öºÅ£¬´Ó¶øÐγÉÒ»¸öÐòÁУ¬¸ÃÐòÁдÓ1¿ªÊ¼£¬ÍùºóÀÛ¼Ó¡£Ã¿´ÎORDER BY±í´ïʽµÄÖµ·¢Éú±ä»¯Ê±£¬¸ÃÐòÁÐÒ²ËæÖ®Ôö¼Ó¡£ÓÐͬÑùÖµµÄÐеõ½Í¬ÑùµÄÊý×ÖÐòºÅ£¨ÈÏΪnullʱÏàµÈµÄ£©¡£Ãܼ¯µÄÐòÁзµ»ØµÄʱûÓмä¸ôµÄÊý
dense_rank() over(partition by ... order by ...)
COUNT
¶ÔÒ»×éÄÚ·¢ÉúµÄÊÂÇé½øÐÐÀÛ»ý¼ÆÊý£¬Èç¹ûÖ¸¶¨*»òһЩ·Ç¿Õ³£Êý£¬count½«¶ÔËùÓÐÐмÆÊý£¬Èç¹ûÖ¸¶¨Ò»¸ö±í´ïʽ£¬count·µ»Ø±í´ïʽ·Ç¿Õ¸³ÖµµÄ¼ÆÊý£¬µ±ÓÐÏàֵͬ³öÏÖʱ£¬ÕâЩÏàµÈµÄÖµ¶¼»á±»ÄÉÈë±»¼ÆËãµÄÖµ£»¿ÉÒÔʹÓÃDISTINCTÀ´¼Ç¼ȥµôÒ»×éÖÐÍêÈ«ÏàͬµÄÊý¾Ýºó³öÏÖµÄÐÐÊý
count(...) over(partition by ... order by ...)
MAX
ÔÚÒ»¸ö×éÖеÄÊý¾Ý´°¿ÚÖвéÕÒ±í´ïʽµÄ×î´óÖµ
max(...) over(partition by ... order by ...)
MIN
ÔÚÒ»¸ö×éÖеÄÊý¾Ý´°¿ÚÖвéÕÒ±í´ïʽµÄ×îСֵ
min(...) over(partition by ... order by ...)
SUM
¸Ãº¯Êý¼ÆËã×éÖбí´ïʽµÄÀÛ»ýºÍ
sum(...) over(partition by ... order by ...)
AVG
ÓÃÓÚ¼ÆËãÒ»¸ö×éºÍÊý¾Ý´°¿ÚÄÚ±í´ïʽµÄƽ¾ùÖµ
avg(...) over(partition by ... order by ...)
FIRST_VALUE
·µ»ØÊý¾Ý×éÖеÚÒ»¸öÖµ
first_value(...) over(partition by ... order by ...)
LAST_VALUE
·µ»ØÊý¾Ý×éÖÐ×îºóÒ»¸öÖµ
last_value(...) over(partition by ... order by ...)
LAG
¿ÉÒÔ·ÃÎʽá¹û¼¯ÖеÄÆäËüÐжø²»ÓýøÐÐ×ÔÁ¬½Ó¡£ËüÔÊÐíÈ¥´¦ÀíÓα꣬¾ÍºÃÏñÓαêÊÇÒ»¸öÊý×éÒ»Ñù¡£ÔÚ¸ø¶¨×éÖпɲο¼µ±Ç°ÐÐ֮ǰµÄÐУ¬ÕâÑù¾Í¿ÉÒÔ´Ó×éÖÐÓ뵱ǰÐÐÒ»ÆðÑ¡ÔñÒÔÇ°µÄÐС£OffsetÊÇÒ»¸öÕýÕûÊý


Ïà¹ØÎĵµ£º

OracleÊý¾Ýµ¼Èëµ¼³ö

OracleÊý¾Ýµ¼Èëµ¼³öimp/exp¾ÍÏ൱ÓÚoracleÊý¾Ý»¹Ô­Ó뱸·Ý¡£expÃüÁî¿ÉÒÔ°ÑÊý¾Ý´ÓÔ¶³ÌÊý¾Ý¿â·þÎñÆ÷µ¼³öµ½±¾µØµÄdmpÎļþ£¬impÃüÁî¿ÉÒÔ°ÑdmpÎļþ´Ó±¾µØµ¼Èëµ½Ô¶´¦µÄÊý¾Ý¿â·þÎñÆ÷ÖС£ÀûÓÃÕâ¸ö¹¦ÄÜ¿ÉÒÔ¹¹½¨Á½¸öÏàͬµÄÊý¾Ý¿â£¬Ò»¸öÓÃÀ´²âÊÔ£¬Ò»¸öÓÃÀ´ÕýʽʹÓá£
    Ö´Ðл·¾³£º¿ÉÒÔÔÚSQLPLUS.EXE»òÕßDOS£¨ÃüÁîÐУ ......

Ð޸ĵçÄÔµÄÖ÷»úÃûoracle agent ·þÎñͻȻÎÞ·¨Æô¶¯

½ñÌìÓöµ½ÕâÑùµÄÎÊÌ⣬ÐÞ¸ÄÖ÷»úÃûºóoracle agent ·þÎñͻȻÎÞ·¨Æô¶¯£¬ÉÏÍøÕÒÁËÒ»»á×öÈçϲÙ×÷¡£¿ÉÒÔÕý³£Ê¹ÓÃÁË
1¡¢½«%oracle_home\ora92\network\adminϵÄlistener.oraºÍtnsnames.oraÄÚµÄËùÓÐÔ­Ö÷»úÃû¸ÄΪÏÖÓÐÖ÷»úÃû»òÕ߹̶¨IPµØÖ·£¨ÒÔ±ã¿Í»§¶Ë»úÆ÷Äܹ»·ÃÎÊServer£©£¬µ±È»Èç¹ûϵͳÖØÆôºó×Ô¶¯¸ÄÕý£¬¿ÉºöÂԴ˲½Öè¡£
2¡¢½«%o ......

Oracle Group By Ó÷¨Ö® —— Having

¿Í»§ÐèÇó·ÖÎö£º
¡¡¡¡±ÊÕß×î½ü½Óµ½Ò»¼Ò¿Í»§µÄÒ»¸öÐèÇó¡£ËûÃDz¿ÊðÁËÒ»¸öERPϵͳ£¬ÏÖÔÚ²ÉÓõľÍÊÇOracleÊý¾Ý¿â¡£ÏÖÔÚÓÉÓÚÆóҵͳ¼Æ·ÖÎöµÄÐèÒª£¬ÒªÊµÏÖÈçϵÄÐèÇó¡£
¡¡¡¡1¡¢°´Ô·ÝÀ´Í³¼Æ2009ÄêµÚÒ»¼¾¶Èÿ¸ö¹©Ó¦É̵IJɹº½ð¶î¡£Ò²¾ÍÊÇ˵£¬ÔÚ±¨±íÖÐÒªÄܹ»ÏÔʾ³ö2009Äê1Ô·ݡ¢2Ô·ݡ¢3Ô·ݹ©Ó¦É̵IJɹº½ð¶îºÏ¼Æ£¬²»ÐèÒªÃ÷ϸ¡£
¡¡¡ ......

oracleѧϰ£¨´´½¨±í£©

ÎÒÏë×î³õѧϰÊý¾Ý¿âʱ¶¼ÊÇÒÔstudent±í¡¢course±íºÍsc±íΪÀýµÄ°É
Ê×ÏÈ´´½¨ÕâÈýÕÅ±í£º±ØҪʱ¿ÉÖØд´½¨Óû§¼°ÃÜÂë²¢µÇ½
»·¾³£ºoracle 10g
declare
  vcnt number;
begin
  select count(*) into vcnt from user_tables where table_name='SC';
  If vcnt = 1 Then
    Execute immedi ......

PHP ÖÐʹÓÃoracle »·¾³ÅäÖÃ

http://www.oracle.com/technology/global/cn/pub/notes/technote_php_instant.html
Ϊ Linux ºÍ Windows °²×° PHP ºÍ Oracle 10g Instant Client
×÷ÕߣºChristopher Jones£¬¼×¹ÇÎĹ«Ë¾µÄ×Éѯ¼¼ÊõÈËÔ±
·¢²¼ÈÕÆÚ£º2004 Äê 12 ÔÂ
Oracle 10g Instant Client£¨Ãâ·ÑÏÂÔØ£©ÊÇPHP ÓëÔ¶³Ì Oracle Êý¾Ý¿âÁ¬½ÓµÄ×î¼òµ¥·½Ê½£¬Ëü ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ