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

Oracle select in/exists/not in/not exits

in ÊÇ°ÑÍâ±íºÍÄÚ±í×÷hash Á¬½Ó£¬¶øexistsÊǶÔÍâ±í×÷loopÑ­»·£¬Ã¿´ÎloopÑ­»·ÔÙ¶ÔÄÚ±í½øÐвéѯ¡£
Ò»Ö±ÒÔÀ´ÈÏΪexists±ÈinЧÂʸߵÄ˵·¨ÊDz»×¼È·µÄ¡£
Èç¹û²éѯµÄÁ½¸ö±í´óСÏ൱£¬ÄÇôÓÃinºÍexists²î±ð²»´ó¡£
in ÊÇ°ÑÍâ±íºÍÄÚ±í×÷hash
Á¬½Ó£¬¶øexistsÊǶÔÍâ±í×÷loopÑ­»·£¬Ã¿´ÎloopÑ­»·ÔÙ¶ÔÄÚ±í½øÐвéѯ¡£
Ò»Ö±ÒÔÀ´ÈÏΪexists±ÈinЧÂʸߵÄ˵·¨ÊDz»×¼È·µÄ¡£
Èç¹û²éѯµÄÁ½¸ö±í´óСÏ൱£¬ÄÇôÓÃinºÍexists²î±ð²»´ó¡£
Èç¹ûÁ½¸ö±íÖÐÒ»¸ö½ÏС£¬Ò»¸öÊÇ´ó±í£¬Ôò×Ó²éѯ±í´óµÄÓÃexists£¬×Ó²éѯ±íСµÄÓÃin£º
ÀýÈ磺±íA£¨Ð¡±í£©£¬±íB£¨´ó±í£©
1£º
select * from A where cc in (select cc from B)
ЧÂʵͣ¬Óõ½ÁËA±íÉÏccÁеÄË÷Òý£»
select * from A where exists(select cc from B where
cc=A.cc)
ЧÂʸߣ¬Óõ½ÁËB±íÉÏccÁеÄË÷Òý¡£
Ïà·´µÄ
2£º
select * from B where cc in (select cc from A)
ЧÂʸߣ¬Óõ½ÁËB±íÉÏccÁеÄË÷Òý£»
select * from B where exists(select cc from A where
cc=B.cc)
ЧÂʵͣ¬Óõ½ÁËA±íÉÏccÁеÄË÷Òý¡£
not in ºÍnot exists
Èç¹û²éѯÓï¾äʹÓÃÁËnot in ÄÇôÄÚÍâ±í¶¼½øÐÐÈ«±íɨÃ裬ûÓÐÓõ½Ë÷Òý£»
¶ønot extsts µÄ×Ó²éѯÒÀÈ»ÄÜÓõ½±íÉϵÄË÷Òý¡£
ËùÒÔÎÞÂÛÄǸö±í´ó£¬ÓÃnot exists¶¼±Ènot inÒª¿ì¡£
in Óë =µÄÇø±ð
select name from student where name in
('zhang','wang','li','zhao');
Óë
select name from student where name='zhang' or
name='li' or name='wang' or name='zhao'
µÄ½á¹ûÊÇÏàͬµÄ¡£
 
http://blog.163.com/sz_putishu/blog/static/121826854200963131426178/


Ïà¹ØÎĵµ£º

sdeÓëoracleµÄ°æ±¾ÎÊÌâ

1.ʹÓòúÆ·£ºarcsde 9.3+oracle 10.2.0.1
2.ÎÊÌâÃèÊö£ºÓÃarcmap·ÃÎÊ¿Õ¼äÊý¾Ý£¬²Ù×÷¼¸·ÖÖÓ£¬arcmapÎÞ·´Ó¦£¬Êý¾Ý¿â·þÎñÆ÷¶ËcpuÕ¼ÓÐÂÊ100%£¬gsrvr.exe½ø³ÌÊý10+¡£
3.½â¾ö°ì·¨£ºÉý¼¶oracle°æ±¾´Ó10.2.0.1Éý¼¶µ½10.2.0.3»òÕß.2.0.4¡£
4.Ô­Òò£º¾Ýesri¹¤³ÌʦËù³Æ£¬oracle10.2.0.1°æ±¾´æÔÚÓëarcgis²»¼æÈݵÄÎÞ·¨µ÷½ÚµÄbug¡£Ä¿Ç°Éý ......

ORACLEÖ´Ðмƻ®µÄһЩ»ù±¾¸ÅÄî

 
Ò»£®Ïà¹ØµÄ¸ÅÄî
RowidµÄ¸ÅÄrowidÊÇÒ»¸öαÁУ¬¼ÈÈ»ÊÇαÁУ¬ÄÇôÕâ¸öÁоͲ»ÊÇÓû§¶¨Ò壬¶øÊÇϵͳ×Ô¼º¸ø¼ÓÉϵġ£¶Ôÿ¸ö±í¶¼ÓÐÒ»¸örowidµÄαÁУ¬µ«ÊÇ
±íÖв¢²»ÎïÀí´æ´¢ROWIDÁеÄÖµ¡£²»¹ýÄã¿ÉÒÔÏñʹÓÃÆäËüÁÐÄÇÑùʹÓÃËü£¬µ«ÊDz»ÄÜɾ³ý¸ÄÁУ¬Ò²²»ÄܶԸÃÁеÄÖµ½øÐÐÐ޸ġ¢²åÈë¡£Ò»µ©Ò»ÐÐÊý¾Ý²åÈëÊý¾Ý¿â£¬Ôò
rowidÔÚ¸ÃÐ ......

oracle ¸ü¸Ä²ÎÊý nls_length_semantics


alter system set nls_length_semantics='BYTE' scope=both
sql>show parameter length
NAME                                 TYPE
------------------------------------ --------------------- ......

ORACLE parent latchºÍchildren latch

         About parent vs child latches. There is no fundamental low level difference between parent and child latches, they are all small regions of memory modified with atomic test-and-set style opcodes.
You see parent (and solitary) latches from x$ksll ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ