ORACLEÍâÁ¬½ÓС½á~
ºÃ¼¸´ÎÏëÓõ½ÍâÁ¬½ÓµÄʱºò¶¼ÍüÁ˾ßÌåµÄÓ÷¨ÊÇÔõÑùµÄ£¬±ÈÈç˵£¨+£©¸Ã¼ÓÔڵȺŵÄÄÄÒ»¶Ë£¬»òÕßLFET OUTER JOIN¸ÃÓÃÔÚÕûÌõÓï¾äÖеÄÄĸö²¿·Ö¡£½ñÌìÕýºÃÓÖÅöµ½Ò»¸öÏà¹ØµÄÎÊÌ⣬½è´Ë»ú»á×ܽáһϣ¬ÒÔºóÒ²·½±ã²éѯ£¬²»ÓÃÿ´Î¶¼È¥°Ù¶ÈÁË¡£
//table1ºÍtable2ΪÁ½¸ö²âÊÔ±í Ëæ±ã²åÈ뼸ÌõÊý¾Ý
SQL> select * from table1;
ID NAME
---------- --------------------
1 wh
2 wp
3 wq
SQL> select * from table2;
ID NAME
---------- --------------------
4 wr
1 wh
//Õý³£²éѯ
SQL> select a.name,b.name
2 from table1 a,table2 b
3 where a.id=b.id;
NAME NAME
-------------------- --------------------
wh wh
//ÏÔʾ³ötable1ÖеÄËùÓмǼ table2ÖÐÎÞÏàÓ¦¼Ç¼ÔòÖÃNULL
SQL> select a.name,b.name
2 from table1 a,table2 b
3 where a.id=b.id(+);
NAME NAME
-------------------- --------------------
wh wh
wq
wp
//ÏÔʾ³ötable2ÖеÄËùÓмǼ table1ÖÐÎÞÏàÓ¦¼Ç¼ÔòÖÃNULL
SQL> select a.name,b.name
2 from table1 a,table2 b
3 where a.id(+)=b.id;
NAME NAME
-------------------- --------------------
wh wh
wr
//ºÇºÇ,ÕâÀï±¾Ïë³¢ÊÔÒ»ÏÂÈ«ÍâÁ¬½Ó,²»¹ýʹÓÃ(+)ºÃÏñ²»ÐÐ
SQL> select a.name,b.name
2 from table1 a,table2 b
3 where a.id(+)=b.id(+);
where a.id(+)=b.id(+)
*
ERROR at line 3:
ORA-01468: a predicate may reference only one outer-joined table
//×óÍâÁ¬½Ó
SQL> select a.name,b.name
2 from table1 a
3 left outer join table2 b
4 on a.id=b.id;
NAME NAME
-------------------- --------------------
wh wh
wq
wp
//ÓÒÍâÁ¬½Ó
SQL> select a.name,b.name
2 from table1 a
3 right outer join table2 b
4 on a.id=b.id;
NAME NAME
-------------------- --------------------
wh wh
wr
//ÓÒÍâÁ¬½Ó
SQL> select a.name,b.name
2 from table2 b
3 right outer join table1 a
Ïà¹ØÎĵµ£º
oracleÖÐconnect by priorʵÏֵݹé²éѯ
ÊÕ¼¯µÄ¼¸ÌõÔÚoracleÖÐͨ¹ýconnect by priorÀ´ÊµÏֵݹé²éѯ
Start with...Connect By×Ó¾äµÝ¹é²éѯһ°ãÓÃÓÚÒ»¸ö±íά»¤Ê÷ÐνṹµÄÓ¦Óá£
´´½¨Ê¾Àý±í£º
CREATE TABLE TBL_TEST
(
ID NUMBER,
NAME VARCHAR2(100 BYTE),
PID NUMBER   ......
Ò». °²×°Ç°µÄ×¼±¸
1.ÔÚÊý¾Ý¿â·þÎñÆ÷ÉÏÒÔAdministratorÉí·ÝµÇ¼µ½Windows
2.Í£Ö¹ËùÓÐOracleÏà¹ØµÄ·þÎñ¡£ÕâЩ·þÎñÃû³ÆÍ¨³£ÊÇÒÔOracle´òÍ·
3.Í£Ö¹Distributed Transaction Coordinator·þÎñ
4.±¸·ÝÓëOracleÊý¾Ý¿âÏà¹ØµÄËùÓÐÎļþ£¨°üÀ¨OracleÊý¾Ý¿âÈí¼þ¼°Êý¾ÝÎļþ£©£¬°ÑÕâЩÎļþ°´ÔÓеÄĿ¼½á¹¹¸´ÖƵ½°²È«µÄµØ·½£¬²¢× ......
°²×°¹ý³ÌÖгöÏÖ“X11/extensions/Print.h: No such file or directory”µÄ½â¾ö·½·¨
ÕâÊÇÒòΪϵͳÖÐȱÉÙlibXp-devel
# yum install libXp-devel
°²×°¹ý³ÌÖгöÏÖ“X11/bitmaps/gray: No such file or directory”µÄ½â¾ö·½·¨
ÕâÊÇÒòΪϵͳÖÐȱÉÙxorg-x11-xbitmaps£¨x11/xbitmaps (Ubuntu) and xorg-x1 ......
ÏÈÀ´¼òµ¥µÄ˵һÏÂORACLEµÄ±¸·Ý·½Ê½£¬Ïêϸ¹¦ÄÜ¿ÉÒÔËÑË÷һϡ£
Ò»ÖÖÊÇÂß¼±¸·Ý£¬¼´ËùνµÄµ¼³ö(Export)ºÍµ¼Èë(Import)ÃüÁÕâÖÖ·½Ê½µÄÓŵãÊÇ£¬Äܹ»¶ÔÊý¾Ý¿âÖеÄÿ¸ö¶ÔÏó½øÐб¸·Ý£¬²¢ÇÒʵÏÖ²»Í¬Æ½Ì¨ÏµÄÊý¾ÝÇ¨ÒÆ£¬µ«±¸·ÝµÄʱºòÊý¾Ý¿â²»ÄÜÊǹرյ쬴ÓCMDÃüÁî½ ......
OracleÊý¾Ý×ֵ䳣Óòéѯ
--²é¿´µ±Ç°Óû§ËùÓÐ±í¼°ÃèÊö
select o.object_name,c.comments
from user_objects o
left outer join user_tab_comments c
on o.object_name=c.table_name
where object_type='TABLE'
and c.comments like '%ÏîÄ¿%'
--²é¿´µ±Ç°Óû§ËùÓÐ×Ö¶ÎÐÅÏ¢¼°ÃèÊö
select c.table ......