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

oracle exists and not exist


ÏÈ¿´ÏÂÃæµÄÀý×Ó:oracleÖÐÁ½¸öϵͳ±í.emp,dept.
example:
1:not exists(not in)
not exists:
   ÕâÌõÓï¾ä·µ»Øselect * from scott.dept d where e.deptno=d.deptno and d.deptno=10Ìõ¼þÂú×ãµÄ½á¹û¼¯.Ò²¾ÍÊÇ˵,
·µ»ØµÄ½á¹û¼¯Öв»´æÔÚd.deptno=10½á¹û¼¯µÄ¼Ç¼,¼´emp±íÖÐûÓÐdept±íÖÐd.deptno=10µÄ¼Ç¼.
SQL> select empno,ename,deptno from scott.emp e where not exists(select * from scott.dept d where e.deptno=d.deptno and d.deptno=10);
EMPNO ENAME      DEPTNO
----- ---------- ------
 7369 SMITH           20
 7499 ALLEN           30
 7521 WARD           30
 7566 JONES           20
 7654 MARTIN         30
 7698 BLAKE           30
 7788 SCOTT           20
 7844 TURNER         30
 7876 ADAMS          20
 7900 JAMES           30
 7902 FORD            20
11 rows selected
not in:
µÚÒ»¸öwhereÌõ¼þ±ØÐë¸ø¶¨×Ö¶Î(deptno), µÚ¶þ¸ösqlÓï¾äÖÐ,±ØÐëÃ÷È·¸ø¶¨Òª²éѯµÄ×Ö¶ÎÊÇÄĸö(deptno).
SQL> select empno,ename,deptno from scott.emp e where deptno not in(select deptno from scott.dept d where e.deptno=d.deptno and d.deptno=10);
EMPNO ENAME      DEPTNO
----- ---------- ------
 7369 SMITH           20
 7499 ALLEN           30
 7521 WARD           30
 7566 JONES         


Ïà¹ØÎĵµ£º

oracle ´æ´¢¹ý³ÌʵÀý


/*²»´øÈκβÎÊý´æ´¢¹ý³Ì(Êä³öϵͳÈÕÆÚ)*/
create or replace procedure output_date is
begin
dbms_output.put_line(sysdate);
end output_date;
/*´ø²ÎÊýinºÍoutµÄ´æ´¢¹ý³Ì*/
create or replace procedure get_username(v_id in number,v_username out varchar2)
as
begin
  select username into v_usern ......

Oracle ÄÚ´æ½á¹¹ºÍ½ø³Ì½á¹¹

Oracle ÄÚ´æ½á¹¹ÈçÏÂͼ£º
1£ºÊµÀý£¨Instance£©        
  ÔÚÒ»¸öÖУ¬Ã¿Ò»¸öÔËÐеÄOracleÊý¾Ý¿â¶¼ÓëÒ»¸öÊý¾Ý¿âʵÀýÏàÁªÏµ£¬ÊµÀýÊÇÎÒÃÇ
 ·ÃÎÊÊý¾Ý¿âµÄÊֶΡ£
  ÊµÀýÔÚ²Ù×÷ϵͳÖÐÓÃORACLE_SIDÀ´±êʶ£¬ÔÚOracleÖÐÓòÎÊýINSTANCE_NAMEÀ´±êʶ£¬
 Ëü ......

oracle 10gÏÂÔØµØÖ·

¼Ç¼һÏÂORACLE 10gR2µÄÈí¼þÏÂÔØµØÖ·£¬±¸Óá£
ÏÂÔØOTNÉϵÄÕâЩÈí¼þ£¬ÄãÐèÒªÒ»¸öOTNÃâ·ÑÕʺţ¬²»¹ýÈç¹ûͨ¹ýѸÀ×½øÐÐÏÂÔØ£¬¾Í²»ÓõǽOTNÁË£º
Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Microsoft Windows (32-bit)
http://download.oracle.com/otn/nt/oracle10g/10201/10201_database ......

oracle ºǫ́½ø³Ì

Ò»¸öʵÀý¿ÉÒÔÓжà¸öºǫ́½ø³Ì,µ«ÊÇ£¬²¢²»ÊÇÿһ¸öºǫ́½ø³Ì¶¼»á³ö³ö£¬Í¨¹ýÊÓͼv$bgprocess¿ÉÒԲ鿴ºǫ́½ø³ÌÐÅÏ¢¡£
Ò»°ãÎÒÃÇÊÇͨ¹ýÒÔÏÂsql²é¿´ºǫ́±ØÐëµÄºǫ́½ø³Ì.
1.²é¿´ºǫ́½ø³Ì
select paddr,name,description
from v$bgprocess
order by paddr desc
£»
2.Õâ¸öÊÓͼÖÐpaddr<>'00'µÄÐж¼ÊÇϵͳÉÏÅäÖúÍÔËÐеĽø³ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ