Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 ÖÐµÄ TO_DATE ºÍ TO_CHAR º¯Êý

oracle ÖÐ TO_DATE º¯ÊýµÄʱ¼ä¸ñʽ£¬ÒÔ 2008-09-10 23:45:56 ΪÀý

¸ñʽ
˵Ã÷
ÏÔʾֵ
±¸×¢

 
Year(Äê):
yy
two digits(Á½Î»Äê)
08
 
yyy
three digits(ÈýλÄê)
008
 
yyyy
four digits(ËÄλÄê)
2008
 
 
Month(ÔÂ):
mm
number(Á½Î»ÔÂ)
09
 
mon
abbre ......

oracle over()º¯Êý¼¼ÊõÏê½â

 Ô­ÎĵØÖ·£ºhttp://hi.baidu.com/zengjl/blog/item/c06c8edeb2c7e45cccbf1aca.html/cmtid/305a850ea57b09ec37d1226c
1.²éѯ±íÊý¾Ý
SQL> select deptno,ename,sal
   2   from emp
   3   order by deptno;
DEPTNO ENAME          SAL ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ