Oracle¸ß¼¶²éѯ
ʹÓÃOracleÌØÓеIJéѯÓï·¨, ¿ÉÒԴﵽʰ빦±¶µÄЧ¹û
1. Ê÷²éѯ
create table tree (
id number(10) not null primary key,
name varchar2(100) not null,
super number(10) not null // 0 is root
);
-- ´Ó×Óµ½¸¸
select * from tree start with id = ? connect by id = prior super
-- ´Ó¸¸µ½×Ó
select * from tree start with id = ? connect by prior id = super
-- Õû¿ÃÊ÷
select * from tree start with super = 0 connect by prior id = super
2. ·ÖÒ³²éѯ
select * from (
select my_table.*, rownum my_rownum from (
select name, birthday from employee order by birthday
) my_table where rownum < 120
) where my_rownum >= 100;
3. ÀÛ¼Ó²éѯ, ÒÔscott.empΪÀý
select empno, ename, sal, sum(sal) over(order by empno) result from emp;
EMPNO ENAME SAL RESULT
---------- ---------- ---------- ----------
7369 SMITH 800 800
7499 ALLEN &
Ïà¹ØÎĵµ£º
²»ÊÇORACLEµÄÎÊÌâ
2009-12-30 15:00
  ......
Èç¹ûÔÚÊÂÎñÖÐÖ´ÐÐÁËÒ»Ìõ²»Âú×ãÌõ¼þµÄupdateÓï¾ä£¬ÔòÖ´ÐÐÈ«±íɨÃ裬°ÑÐм¶ËøÉÏÉýΪ±í¼¶Ëø£¬¶à¸öÕâÑùµÄÊÂÎñÖ´Ðк󣬾ͺÜÈÝÒײúÉúËÀËø¡£
ËÀËøÒ»°ãÊÇÒò×¾ÁÓµÄÊÂÎñÉè¼Æ¶ø²úÉú insert, update, delete
1.°´Óû§Óëϵͳ»®·Ö£¬¿ÉÒÔ·ÖΪ×Ô¶¯ËøÓëÏÔÊ¾Ëø
×Ô¶¯Ëø£ºµ±½øÐÐÒ»ÏîÊý¾Ý¿â²Ù×÷ʱ£¬È±Ê¡Çé¿öÏ£¬ÏµÍ³×Ô¶¯Îª´ËÊý¾Ý¿â²Ù×÷»ñµÃËùÓ ......
1¡¢´ÓrootÓû§Çл»µ½oracleÓû§
#su - oracle
2¡¢ÀûÓÃnologÑ¡ÏîÆô¶¯sql*plus¹¤¾ß³ÌÐò
$slqplus /nolog
3¡¢ÀûÓÃsysdbaÉí·ÝÆô¶¯oracleÊý¾Ý¿â
sql>connect / as sysdba
sql>startup
4¡¢Æô¶¯Êý¾Ý¿âµÄ¼àÌýÆ÷listener
$lsnrctl start
»ò
$lsnrctl
lsnrctl>start
5¡¢¹Ø±ÕoracleÊý¾Ý¿â¼àÌý
$lsnrctl stop
6¡ ......
ÔÎĵØÖ·£ºhttp://www.cnblogs.com/yf520gn/archive/2009/01/12/1374359.html
EXISTSµÄÖ´ÐÐÁ÷³Ì
select * from t1 where exists ( select null from t2 where y = x )
¿ÉÒÔÀí½âΪ:
for x in ( select * from t1 )
loop
if ( exists ( select null from ......
oracle 9i online documentation:
http://www.oracle.com/pls/db92/db92.docindex?remark=homepage
oracle 10g online documentation:
http://www.oracle.com/pls/db102/homepage
oracle 11g online documentation:
http://www.oracle.com/pls/db111/homepage ......