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

oracleÏÂÕâÑùµÄ²éѯÔõôŪ£¡

table1
number  name
511    ±±¾©
512    ÉϺ£
513    ¹ãÖÝ
514    ÉîÛÚ
611    ³É¶¼
612    ÖØÇì
...

table2£¨Õâ¸öÊÇÄÚÈÝ±í£¬number¶ÔÓ¦table1µÄnumber£©
number  ....
511   
512
512


²éѯ½á¹û
number    name    count
511      ±±¾©    1
512      ÉϺ£    2
513      ¹ãÖÝ    0
514      ÉîÛÚ    0

£¨³É¶¼ºÍÖØÇì¶¼²»Òª£¬ÒòΪËûÃÇÊÇ¡®61¡¯¿ªÍ·µÄ£©
1.Èç¹û¿ÉÒÔ£¬Çë¸øÏÂsql´úÂë



select t1.name,t1.number, sum(nvl(t2.number, 0)) count from t1, t2 where t1.number=t2.number(+) and t1.number not like '61%' group by t1.name,t1.number



select t1.name,t1.number, sum(nvl(t2.number, 0)) count from t1, t2 where t1.number=t2.number(+) and t1.number not like '61%' group by t1.name,t1.number
Õâ¸öЧÂÊÔõôÑù°¡£¿
ÒòΪtable2£¨ÄÚÈÝ±í£©ÖÐÊý¾ÝÁ¿¿ÉÄÜ»áÓеã¶à(200w×óÓҵıê×¼)


SQL code:

select distinct t1.number,t1.name,count(t2.number) over(partition by t1.name)
from table1 t1,table2 t2
where t1.number = t2.number




Ïà¹ØÎÊ´ð£º

javaÔõôÁ¬½ÓOracle£¬¼±°¡ - Java / JavaÏà¹Ø

private static final String URL = "jdbc:oracle:thin:@localhost:1521:orcl";
private static final String USERNAME = "sys";
private static final String PASSWORD = "s ......

linuxÏÂCÓïÑÔ¿ª·¢oracleµÄÎÊÌâ¡£

Á½¸öÎļþ1.PC£¬1.inc
1.PCÓвÙ×÷oracleÊý¾Ý¿âµÄ ,1.incÒ²ÓвÙ×÷oracleÊý¾Ý¿â 
ÔÚÆäËûÊý¾ÝÖÐÈçinformix ÖÐ$include 1.inc¾Í¿ÉÒÔʹÓÃÁË
ÔÚORACLEÊý¾Ý¿âÖØ $include 1.inc²»¿ÉÓà EXEC SQL include 1.incÒ²²»¿É ......

oracle 9i ×î½ü·¢Ïֵǽ±¨´í - Oracle / »ù´¡ºÍ¹ÜÀí

ÓÃPL/SQL µÇ½ʱµ¯³ö±¨´í´°¿Ú£¬´íÎóÈçÏ£¡
  ORA-01034:ORACLE not available
  ORA-27101:shared memory realm does not exist
ÇëÎÊ£¬ÓÐûÓÐÈËÓöµ½ÕâÖÖÇé¿ö£¬Ôõô½â¾ö£¿Ð»Ð»£¡

1. Oracle sid ÕýÈ ......

OracleµÄblob×Ö¶ÎÎÊÌâ - Oracle / ¿ª·¢

²éÁËÒ»ÌìµÄblob£¬»¹ÊÇûÀí½âµ½£¬ÎÒÏëÔÚVCÏ´æÈ¡¶þ½øÖƵÄÎļþ£¬Ê¹ÓõÄÊÇoo4o£¬ÕÕ×ŰïÖúÎĵµÉÏÃæµÄдÁËдÈëÊý¾Ý¿âµÄ´úÂ룬»¹ÊÇûд¶Ô£¬´íÎóÌáʾÊÇthis operation is not permitted on a empty LOB£¬ÕâÊÇʲôÒâ˼°¡£¿ÕÕ ......

eclipseÖÐÁ¬½ÓoracleµÄÎÊÌâ - Oracle / »ù´¡ºÍ¹ÜÀí

eclipse 3.3Æô¶¯web¹¤³Ì£¬ÒªÁ¬½Óoracle9iÊý¾Ý¿â±¨
ÑÏÖØ: Cannot create PoolableConnectionFactory (Listener refused the connection with the following error:
ORA-12518, TNS:listener could not hand off cli ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ