Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

½âÎöoracleµÄrownum

¶ÔÓÚrownumÀ´ËµËüÊÇoracleϵͳ˳Ðò·ÖÅäΪ´Ó²éѯ·µ»ØµÄÐеıàºÅ£¬·µ»ØµÄµÚÒ»ÐзÖÅäµÄÊÇ1£¬µÚ¶þÐÐÊÇ2£¬ÒÀ´ËÀàÍÆ£¬Õâ¸öα×ֶοÉÒÔÓÃÓÚÏÞÖƲéѯ·µ»ØµÄ×ÜÐÐÊý£¬¶øÇÒrownum²»ÄÜÒÔÈκαíµÄÃû³Æ×÷Ϊǰ׺¡£
¾ÙÀý˵Ã÷£º
ÀýÈç±í£ºstudent(ѧÉú)±í£¬±í½á¹¹Îª£º
ID¡¡¡¡¡¡    char(6)¡¡¡¡¡¡¡¡¡¡ --ѧºÅ
name¡¡¡¡¡¡¡¡VARCHAR2(10)¡¡¡¡¡¡--ÐÕÃû
create table student (ID char(6), name VARCHAR2(100));
insert into sale values('200001',‘ÕÅÒ»’);
insert into sale values('200002',‘Íõ¶þ’);
insert into sale values('200003',‘ÀîÈý’);
insert into sale values('200004',‘ÕÔËÄ’);
commit;
(1) rownum ¶ÔÓÚµÈÓÚijֵµÄ²éѯÌõ¼þ
Èç¹ûÏ£ÍûÕÒµ½Ñ§Éú±íÖеÚÒ»ÌõѧÉúµÄÐÅÏ¢£¬¿ÉÒÔʹÓÃrownum=1×÷ΪÌõ¼þ¡£µ«ÊÇÏëÕÒµ½Ñ§Éú±íÖеڶþÌõѧÉúµÄÐÅÏ¢£¬Ê¹ÓÃrownum=2½á¹û²é²»µ½Êý¾Ý¡£ÒòΪrownum¶¼ÊÇ´Ó1¿ªÊ¼£¬µ«ÊÇ1ÒÔÉϵÄ×ÔÈ»ÊýÔÚrownum×öµÈÓÚÅжÏÊÇʱÈÏΪ¶¼ÊÇfalseÌõ¼þ£¬ËùÒÔÎÞ·¨²éµ½rownum = n£¨n>1µÄ×ÔÈ»Êý£©¡£
SQL> select rownum,id,name from student where rownum=1;£¨¿ÉÒÔÓÃÔÚÏÞÖÆ·µ»Ø¼Ç¼ÌõÊýµÄµØ·½£¬±£Ö¤²»³ö´í£¬È磺ÒþʽÓα꣩
SQL> select rownum,id,name from student where rownum=1;
    ROWNUM ID     NAME
---------- ------ ---------------------------------------------------
         1 200001 ÕÅÒ»
SQL> select rownum,id,name from student where rownum =2;
    ROWNUM ID     NAME
---------- ------ ---------------------------------------------------
£¨2£©rownum¶ÔÓÚ´óÓÚijֵµÄ²éѯÌõ¼þ
   Èç¹ûÏëÕÒµ½´ÓµÚ¶þÐмǼÒÔºóµÄ¼Ç¼£¬µ±Ê¹ÓÃrownum>2ÊDz鲻³ö¼Ç¼µÄ£¬Ô­ÒòÊÇÓÉÓÚrownumÊÇÒ»¸ö×ÜÊÇ´Ó1¿ªÊ¼µÄαÁУ¬Oracle ÈÏΪrownum> n(n>1µÄ×ÔÈ»Êý)ÕâÖÖÌõ¼þÒÀ¾É²»³ÉÁ¢£¬ËùÒԲ鲻µ½¼Ç¼
SQL> select rownum,id,name from student where rownum >2;
ROWNUM ID     NAME
---------- ------ ---------------------------------------------------
ÄÇÈçºÎ²ÅÄÜÕÒµ½µÚ¶þÐÐÒÔºóµÄ¼Ç¼ѽ¡£¿ÉÒÔʹÓÃÒÔϵÄ×Ó²éѯ·½·¨À´½â¾ö¡£×¢Òâ×Ó²éѯÖеÄrownum±ØÐëÒªÓбðÃû£¬·ñÔò»¹ÊDz»»á²é³ö¼Ç¼À´£¬ÕâÊÇÒò


Ïà¹ØÎĵµ£º

oracleÖÐrownumµÄÓ÷¨

 
rownum ÕæµÄÊǺܺõĶ«Î÷£¬ÏÖÔÚ´ó¶àÊýÓÃÓÚ´æ´¢¹ý³Ì·ÖÒ³. µ«ÔõôÓÃÄØ£¿Õâ¾ÍÀ´Ñо¿Ò»Ï¡£ ºÙºÙ
--- ÒÔÏÂΪתÔØÖ®´¦£¬½ö¹©Ñ§Ï°
¶ÔÓÚrownumÀ´ËµËüÊÇoracleϵͳ˳Ðò·ÖÅäΪ´Ó²éѯ·µ»ØµÄÐеıàºÅ£¬·µ»ØµÄµÚÒ»ÐзÖÅäµÄÊÇ1£¬µÚ¶þÐÐÊÇ2£¬ÒÀ´ËÀàÍÆ£¬Õâ¸öα×ֶοÉÒÔÓÃÓÚÏÞÖƲéѯ·µ»ØµÄ×ÜÐÐÊý£¬¶øÇÒrownum²»ÄÜÒÔÈκαíµÄà ......

Oracle±Ê¼Ç

Oracle µÄ´úÂë±íʾ¼°ÊÂÀý
 
1.  select + xxx + from + xxx   //²éѯÓï¾ä  xxx ±íʾһ¸ö±í  
     Select  *  from  + xxx   // * ±íʾһ¸öÁбíÖÐËùÓеÄÄÚÈÝ
 
  Àࣺ 1£©//  select * from country
 
   ......

OracleºÍTomcat¶Ë¿Ú³åÍ»

OracleºÍTomcat¶Ë¿Ú³åÍ»
Ô­Òò:
    Oracle 9i¿ªÊ¼£¬´´½¨Êý¾Ý¿âʱĬÈÏ°üº¬ÁËXDBÌØÐÔ¡£Ò»µ©Æô¶¯ÁËÊý¾Ý¿âºÍListener£¬Oracle XDBµÄhttp·þÎñ¾ÍÕ¼ÓÃ8080¶Ë¿Ú£¬¸ÕºÃºÍJBoss¡¢TomcatµÈĬÈ϶˿ڳåÍ»¡£
½â¾ö·½·¨
 1¡¢¸Ä¶¯tomcat¶Ë¿Ú£¬
´ò¿ªD:\Tomcat5\conf\server.xml£¬²éÕÒÈçÏÂÎı¾Î»Öãº
<!-- Def ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ