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

oracleº¯ÊýÏê½â

1¡¢SQL Óï¾ä»ù´¡
ÏÂÃæ¸ø³öSQLÓï¾äµÄ»ù±¾½éÉÜ¡£
1.1¡¢SQLÓï¾äËùÓ÷ûºÅ
²Ù×÷·û ÓÃ; Àý×Ó
+ - ±íʾÕýÊý»ò¸ºÊý£¬ÕýÊý¿Éʡȥ + -1234.56
+ ½«Á½¸öÊý»ò±í´ïʽ½øÐÐÏà¼Ó A=c+b
- ½«Á½¸öÊý»ò±í´ïʽ½øÐÐÏà¼õ 34-12
* ½«Á½¸öÊý»ò±í´ïʽ½øÐÐÏà³Ë 12*34
/ ³ýÒÔÒ»¸öÊý»ò±í´ïʽ 18*11
NULL ¿ÕÖµÅÐ¶Ï Where name is null;
|| ×Ö·û´®Á¬½Ó ‘101-’||tel_num
= µÈÓÚ²âÊÔ Select * from emp  where name=’ÕÔÔª½Ü’;
!= »ò<>»ò^= ²»µÈÓÚ²âÊÔ Select * from emp  where name !=’ÕÔÔª½Ü’;
<
  СÓÚ²âÊÔ Select * from emp  where sal < 5000;
>
  ´óÓÚ²âÊÔ Select * from emp  where sal > 5000;
<= СÓÚµÈÓÚ²âÊÔ Select * from emp  where sal <= 5000;
>= ´óÓÚµÈÓÚ²âÊÔ Select * from emp  where sal >= 5000;
Not in ²âÊÔijֵÊÇ·ñÔÚÒ»¸öÖ¸¶¨µÄ½á¹û¼¯ÖÐ Select name,addr from expert where local not in(‘±±¾©’,’ÉϺ£’);
ANY ½«Ò»¸öÖµÓëÒ»×éÖµ½øÐбȽϣ¬·µ»ØÂú×ãÌõ¼þµÄ½á¹û¡£±ØÐë¸ú!=,<,>,<=,>= select ename,sal from emp where sal<= any(select sal from emp where deptno=10)
SOME ͬANY£¬±ØÐë¸ú!=,<,>,<=,>=
 
ALL ½«Ò»¸öÖµÓëÒ»×éÖµ±È½Ï£¬·µ»ØÂú×ãÌõ¼þµÄËùÓÐÁÐÖµ¡£±ØÐë¸ú!=,<,>,<=,>= Select name,sal from emp w here sal<= all
( 500,800,1200);
Not between
A and B ÅжÏij¸öÖµÊÇ·ñ½çÓÚÁ½ÕßÖ®¼ä¡£ Select name,sal from emp Where
sal between 500 and 1200;
[not]exists ÅжÏij¸öÁÐÊÇ·ñ´æÔÚÓÚÒ»×éÖµÖС£ select dname,deptno from dept where exists
(select * from emp where dept.deptno=emp.deptno)
A[not]like b
  ±È½ÏÁ½¸öģʽÊÇ·ñÏàËÆ£¬µ±Ê¹ÓÃlike Óï¾äʱOracle²»È¥·ÃÎÊË÷Òý¡£ Select * from emp
Where ename like ‘TH%’;
Is [not] null  ²âÊÔÖµÊÇ·ñΪ¿Õ¡£ Select ename,deptno from emp
Where comm. Is null or comm.=0;
Not ¶Ô½á¹ûµÄ·ñ¶¨¡£ Select * from emp Where sal not(sal<1000); µÈ¼ÛÓÚselect ename,sal from emp where sal>=1000;
AND ÓÃÓÚÅжÏÁ½¸öÌõ¼þÊ®·Ö¶¼Âú×ã¡£ Select * from emp where
Ename=’SIMTH’ and sal>=1000;
OR ÓÃÓÚÅжÏÁ½


Ïà¹ØÎĵµ£º

ѧºÃOracleÁùÌõ×ܽá

 
1¡¢Èç¹ûÓÐÒ»¶¨µÄÊý¾Ý¿â»ù´¡£¬ÖªµÀSQLÊÇÔõô»ØÊ£¬¼´Ê¹Ð´²»³öÀ´¼òµ¥µÄSQL£¬µ«¿ÉÒÔ¿´¶¯ËüÃÇ£¬Äã¾Í¿ÉÒÔÌøµ½2¡£·ñÔòÇëÏÈ¿´Ò»ÏÂÊý¾Ý¿â»ù´¡ºÍSQLÓïÑÔ£¬²»ÐèÒªºÜÉ¸ü²»ÐèҪȥ¼ÇÒäÄÇЩ¸´ÔÓµÄSQLÃüÁÕâЩ¿ÉÒÔÁôÔÚÒÔºó±ßÓ¦Óñßѧϰ¡¢¼ÇÒä¡£
¡¡¡¡
¡¡¡¡2¡¢ÒªÏëѧºÃORACLE£¬Ê×ÏÈҪѧϰORACLEµÄÌåϵ½á¹¹£¬ÏÖÔÚÄã²»ÐèÒªÉîÈëÀ ......

oracle ´æ´¢¹ý³ÌµÄ»ù±¾Óï·¨

1.»ù±¾½á¹¹
CREATE OR REPLACE PROCEDURE ´æ´¢¹ý³ÌÃû×Ö
(
    ²ÎÊý1 IN NUMBER,
    ²ÎÊý2 IN NUMBER
) IS
±äÁ¿1 INTEGER :=0;
±äÁ¿2 DATE;
BEGIN
END ´æ´¢¹ý³ÌÃû×Ö
2.SELECT INTO STATEMENT
  ½«select²éѯµÄ½á¹û´æÈëµ½±äÁ¿ÖУ¬¿ÉÒÔͬʱ½«¶à¸öÁд洢¶à¸ö±äÁ¿ÖУ¬±ØÐëÓÐÒ»Ì ......

Oracle´æ´¢¹ý³Ì£¬ÒÔÓαêµÄ·½Ê½·µ»ØÒ»¸ö¼Ç¼¼¯


--´´½¨Ò»¸ö°ü
create or replace package types
as
type cursorType is ref cursor;
end types;
--´´½¨´æ´¢¹ý³Ì,ÓαêÀàÐÍ·µ»Ø²ÎÊý
create or replace procedure SP_Fee_Instance(v_company in varchar, v_sdate in nva ......

oracleÖÐʵÏÖÖ÷¼ü×Ô¶¯Éú³É

 IDÊÇÖ÷½¡£¬ÊµÏÖ²åÈëÒ»¸öNAME,ID×Ô¶¯Ôö¼Ó
SQL>   create   table   t1  
      2     (  
      3         id    & ......

Oracleº¯Êý´óÈ«

SQLÖеĵ¥¼Ç¼º¯Êý
1.ASCII
·µ»ØÓëÖ¸¶¨µÄ×Ö·û¶ÔÓ¦µÄÊ®½øÖÆÊý;
SQL> select ascii('A') A,ascii('a') a,ascii('0') zero,ascii(' ') space from dual;
        A         A      ZERO     ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ