ÔÚoracleÖйØÓÚÊ÷µÄsql
±ítask£¬×Ö¶Îid_£¬name_
id_µÄÊý¾ÝÈçÏÂÐÎʽ£º
1
1.1
1.1.1
1.1.1.2
1.2
1.2.1
...
10
10.1
10.1.1
10.2.1
10.2.1.1
10.2.1.1.1
10.2.1.1.2
.......
×¢£º“.”±êʶ¸¸×ӵĹØÏµ¡£
ÏÖÔÚͨ¹ýid_²éѯÊ÷½á¹¹µÄЧ¹û£¬²¢ÇÒÖªµÀ´Ë½ÚµãÊÇ·ñΪҶ×Ó½Úµãleaf¡£¡££¿
Óï¾äÈçÏ£º
select
id_ ,
name_ ,
(select count(id_) from task where t.id_= substr(id_,0,INSTR((id_),'.',-1)-1) ) as leaf,connect_by_isleaf from task t
start with t.id_ ='5' connect by prior
t.id_= substr(t.id_,0,INSTR((t.id_),'.',-1)-1) order by t.id_
Ïà¹ØÎĵµ£º
ÈÕ³£¿ª·¢»î¶¯ÖУ¬ÓÐʱºòÐèÒª¶ÔoracleÖ´Ðмƻ®½øÐÐ¼à¿Ø£¬ÒÔ´ËÀ´µ÷ÓųÌÐòºÍÊý¾Ý¿â·½ÃæµÄÐÔÄÜ¡£
³£Ó÷½·¨ÓÐÒÔϼ¸ÖÖ£º
Ò»¡¢Í¨¹ýPL/SQL Dev¹¤¾ß
1¡¢Ö±½ÓFile->New->Explain Plan Window£¬ÔÚ´°¿ÚÖÐÖ´ÐÐsql¿ÉÒԲ鿴¼Æ»®½á¹û¡£ÆäÖУ¬Cost±íʾcpuµÄÏûºÄ£¬µ¥Î»Îªn%£¬Cardinality±íʾִÐеÄÐÐÊý£¬µÈ¼ÛRow ......
±í¡¡¡¡¡¡¡¡tree
¡¡¡¡×ֶΡ¡¡¡¡¡master
¡¡¡¡¡¡¡¡¡¡¡¡¡¡sub
¡¡¡¡¡¡¡¡¡¡¡¡¡¡sales
¡¡¡¡insert into tree values
¡¡¡¡('Ö÷1',¡¡¡¡ 'Ö÷2',¡¡ 15);¡¡
¡¡¡¡insert into tree values¡¡¡¡¡¡
¡¡¡¡('Ö÷1',¡¡¡¡ 'Ö÷3',¡¡ 20);¡¡¡¡¡¡¡¡¡¡
¡¡¡¡insert into tree values
¡¡¡¡('Ö÷2',¡¡¡¡ 'Ö÷4',¡¡¡¡5);¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡ ......
1. Oracle°²×°Íê³ÉºóµÄÔʼ¿ÚÁ
¡¡internal/oracle
¡¡¡¡sys/change_on_install
¡¡¡¡system/manager
¡¡¡¡scott/tiger
¡¡¡¡sysman/oem_temp
2. ORACLE9IAS WEB CACHEµÄÔʼĬÈÏÓû§ºÍÃÜÂ룿
administrator/administrator
3. oracle 8.0.5ÈçºÎ½¨Á¢Êý¾Ý¿â£¿
ÓÃorainst¡£¼ÙÈçÓÐmotif½çÃæ£¬Äܹ»ÓÃorainst /m¡ ......
ȨÏÞ¹ÜÀí
Oracle 9i
3¸öĬÈÏÓû§
sys(³¬¼¶¹ÜÀíÔ±) ĬÈÏÃÜÂ룺change_on_install
system£¨ÆÕͨ¹ÜÀíÔ±£©
ĬÈÏÃÜÂ룺manager
scott£¨ÆÕͨÓû§£© ĬÈÏÃÜÂ룺tiger
Oracle 10g
sys£¨ÃÜÂëÔÚ°²×°Ê±ÉèÖã©
system£¨ÃÜÂëÔÚ°²×°Ê±ÉèÖã©
scott(ĬÈÏËø¶¨£¬ÏëÓõýâËø)
Æô¶¯Windo ......