oracle¼òµ¥Óï·¨±Ê¼Ç
¡¡
¡¡
DML Data manipulation language
SELECT
SELECT [DISTINCT] *|ÁÐxx [AS] "±ðÃûxx"[,ÁÐxx "±ðÃûxx"...]
×Ö·û´®Á¬½Ó·û ||, ×Ö·û»òÈÕÆÚÀàÐ͵Ä×Ö·û´®Óõ¥ÒýºÅ’’, ÁбðÃûÓÃË«ÒýºÅ“”¡£Èç¹û±ðÃûÖÐÓпոñ¡¢ÌØÊâ×Ö·û»òÕßÒªÇóÇø·Ö´óСд£¬±ØÐëÓÃË«ÒýºÅ¡£Ä¬ÈÏÇé¿öÏÂÁбêÌâΪ´óд£¬×Ö·ûºÍÈÕÆÚ±êÌâ¿¿×ó£¬Êý×Ö¿¿ÓÒ
ÁбðÃû¿ÉÒÔÓÃÔÚorder byÖУ¬µ«²»ÄÜÓÃÔÚwhereºÍgroup byÀï
SQL²»Çø·Ö´óСд£¬¹Ø¼ü×Ö²»Äܼòд»ò·ÖÐÐд£¬Óï¾ä½áÊøÓÃ;
ROWID,ROWNUMÐбêºÅ£¬ÐéÄâÁÐ
DISTINCTÏû³ýÖظ´ÁÐ
¡¡
from ±íxx ±í±ðÃûxx[£¬±íxx ±í±ðÃûxx...]
¡¡
¡¡
WHERE Ìõ¼þ
is NOT Null£¬is Null,NULLÊDz»È·¶¨µÄδ֪µÄÖµ
+ - * /
> >= = <= < <> !=
and, or, not
[not] between .. and
In, not In
Like, not like (%ÈÎÒⳤ¶È£¬_Ò»¸ö³¤¶È)
Like 'a/%' Escape '/' = like 'a%', escape ¶¨ÒåתÒå×Ö·û/£¬Ò²¿ÉÒÔÓÃÆäËû×Ö·û
ÓÅÏȹæÔò£ºËãÊõ¡·Á¬×Ö¡·±È½Ï¡·[not] null,like,in¡·[not] between¡·not¡·and¡·or
¡¡
GROUP BY ·Ö×éÁÐ HAVING ·Ö×éÌõ¼þ
·Ö×麯ÊýÖ»ÔÚ·Ö×éÖÐʹÓÃ(select,having)£¬²»ÔÊÐíÔÚwhereÖУ¬ÒªÖ¸¶¨Ìõ¼þÓÃhaving¡£
Select¹Ø¼ü×ÖÖ®ºóÁгöµÄÿ¸öͳ¼Æº¯ÊýÖ®ÍâµÄ×ֶΣ¬¶¼Òª³öÏÖÔÚgroup byÖ®ºó
ÓÃWhereÌõ¼þ½øÐзÖ×éÇ°µÄ¹ýÂË£¬having½øÐзÖ×éºóµÄ¹ýÂË£¬¼´Ö¸¶¨ÄÄЩ·Ö×é½á¹û±»ÏÔʾ
¡¡
ORDER BY ÅÅÐò×ֶΠASC|DESC
order byºó¿ÉÒÔÊÇ×ֶλòÕß×Ö¶ÎÔËËãºóµÄ±í´ïʽ£¬Ä¬ÈÏAsc
order by¿ÉÒÔÓÃÁбðÃû£¬selectÖеÄÁÐÐòºÅ£¬Ò²¿ÉÒÔÊDz»ÔÚselectÖеÄÁÐ
¶à±í²éѯSQL:1999
select * from emp CROSS JOIN dept
½»²æÁ¬½Ó£º»á²úÉúµÑ¿¨¶û»ý
¡¡
select * from emp Netural JOIN dept
×ÔÈ»Á¬½Ó£º×Ô¶¯¹ØÁªÁ½¸ö±íÖÐÓÐÏàͬÃû×ÖºÍÊý¾ÝÀàÐ͵ÄÁÐ
¡¡
select * from emp JOIN dept USING(deptno)
Using×Ӿ䣺ֱ½Ó¹ØÁªÁÐ
¡¡
select * from emp e JOIN dept d ON(e.deptno=d.deptno)
On×Ӿ䣺Óû§×Ô¼º±àд¹ØÁªÌõ¼þ£¬¿ÉÒÔÓöà¸öjoin..onÁ¬½Ó¶à¸ö±í
¡¡
select * from emp e RIGHT OUTER JOIN dept d ON(e.deptno=d.deptno)
ÓÒÍâÁ¬½Ó£ºÏ൱ÓÚwhere e.deptno(+)=d.deptno
(+)·ÅÔÚÁ¬½ÓµÄȱÉÙÐÅÏ¢µÄÒ»²àµÄÁÐÃûºóÃ棬ÈçÏÔʾûÓÐÔ±¹¤µÄ²¿ÃÅ£¬½«+·ÅÔÚÔ±¹¤±íºóÃ棻ÏÔʾûÓв¿ÃŵÄÔ±¹¤£¬½«+·ÅÔÚ²¿ÃűíºóÃæ
¡¡
select * from emp e LEFT OUTER JOIN dept d ON(e.deptno=d.deptno)
×óÍâÁ¬½Ó£ºÏ൱ÓÚ where e.deptno=d.dept
Ïà¹ØÎĵµ£º
OracleÓ¦ÓÃϵͳµÄÓÅ»¯Ëĸö·½Ãæ
1.¡¡¡¡¡¡ Ó¦ÓóÌÐòSQLÓï¾äÓÅ»¯;
2.¡¡¡¡¡¡ ORACLEÊý¾Ý¿â²ÎÊýµ÷Õû;
3.¡¡¡¡¡¡ ²Ù×÷ϵͳ²ÎÊýµ÷Õû;
4.¡¡¡¡¡¡ ÍøÂçÐÔÄܵ÷Õû.
oracleÓ¦ÓÃϵͳµÄÐÔÄÜÖ¸±ê
1.¡¡¡¡¡¡ Êý¾Ý¿âÍÌÍÂÁ¿;
2.¡¡¡¡¡¡ Êý¾Ý¿âÓû§ÏìӦʱ¼ä.
ORACLEÊý¾Ý¿âÐÔÄÜÓÅ»¯µÄ¼¸¸ö²¿·Ö
Êý¾Ý¿âÐÔÄÜÓÅ»¯°üÀ¨Èçϼ¸¸ö²¿·Ö£º
1¡¢1¡¢µ÷Õ ......
ÔÚµ±½ñÍøÂçʱ´ú£¬ÎÒÃǶÔÊý¾ÝµÄ´æ´¢ÊÇÔ½À´Ô½¸ß£¬½ö½ö´æ´¢Ð¡ÐÍÎı¾Êý¾ÝÒѾԶԶ²»¹»ÁË£¬ÏÖÔÚÊý¾Ý¿âÐèÒª´æ´¢Í¼Æ¬¡¢ÊÓƵµÈµÈһЩ¶àýÌåµÄÄÚÈÝ£¬Òò´Ëoracle¸øÎÒÃÇÌṩÁËÒ»ÖÖ´óÀàÐÍÊý¾Ý¿â¶ÔÏóLOB(Large Object),¿ÉÒÔÓÃÓÚ´æ´¢´óÐÍÊý¾Ý¡£
Ò»¡¢´ó¶ÔÏóµÄ4ÖÐÊý¾ÝÀàÐÍ
CLOB ×Ö·ûLOBÊý¾ÝÀàÐÍ£¬ÓÃÓ ......
µ±ÄãÔÚÊý¾Ý¿âÖд´½¨Êý¾Ý±íµÄʱºò£¬ÄãÐèÒª¶¨Òå±íÖÐËùÓÐ×ֶεÄÀàÐÍ¡£ORACLEÓÐÐí¶àÖÖÊý¾ÝÀàÐÍÒÔÂú×ãÄãµÄÐèÒª¡£Êý¾ÝÀàÐÍ´óÔ¼·ÖΪ£ºcharacter, number, date, LOB, ºÍRAWµÈÀàÐÍ¡£ËäÈ»ORACLE8iÒ²ÔÊÐíÄã×Ô¶¨ÒåÊý¾ÝÀàÐÍ£¬µ«ÊÇËüÃÇÊÇ×î»ù±¾µÄÊý¾ÝÀàÐÍ¡£ÔÚÏÂÃæµÄÎÄÕÂÖÐÄ㽫Á˽⵽ËûÃÇÔÚoracle ÖеÄÓ÷¨¡¢ÏÞÖÆÒÔ¼°ÔÊÐíÖµ¡£
¡¡¡¡
¡¡¡¡ ......
1 oracle ʵÀý
°²×°--È«¾ÖÊý¾Ý¿âÃû£º¿ÉÒÔ¼ÓÀ©Õ¹Ãû£º±ÈÈçtest.com.cn£¨¶øÊý¾Ý¿âʵÀýÃûΪtest£©
Êý¾Ý¿â¿ÚÁî:ΪÊý¾Ý¿âϵͳÕÊ»§£ºsys,system,sysman,dbsnmpÌṩÃÜÂë
¸ß¼¶°²×°£ºÎªÃ¿¸öÓû§Ìṩ²»Í¬µÄÃÜÂë
sys: change_on_install
system:manager
sysman:oem_temp
dbsnmp:dbsnmp
internal: orcale
scott:tiger
demo: ......