linux Oracle ÏÂʹÓÃrownumºÜÂý - Oracle / ¿ª·¢
ÎÒÔÚLinuxÉÏ×°ÁËOracleÊý¾Ý¿â£¬ÆäÖÐÓÐÒ»¸ö±í£¬´óÔ¼ÓÐ90000ÌõÊý¾Ý£¬ÓÃOracle½øÐзÖÒ³²éѯµÄʱºò£¬·¢ÏÖºÜÂý
sqlÓï¾äÈçÏ£º
select *
from (select row_.*, rownum rownum_
from (select * from usercontract
order by CODE) row_)
where rownum_ <= 100
and rownum_ > 80
ÆäÖÐcode²»ÊÇÖ÷¼ü£¬µ«ÊÇÎÒ°´ÕÕcode½¨ÁËË÷Òý£¬
²éѯ´óÔ¼ÐèÒª7s£¬
¸÷λ¸ßÊÖÇë°ïæ·ÖÎöÒ»ÏÂ
Ö´Ðмƻ®ÊÇʲô£¿ÏÂÃæµÄд·¨¿ÉÒÔÉÙɨһ´Î£¬ÊÔÊÔ£º
SQL code:
select * from (
select rownum rn, t1.*
from usercontract t1
order by code) t2
where t2.rn between 80 and 100;
Ó¦¸Ã²»ÊÇROWNUMÔì³ÉµÄ£¬ÄãµÄÖ´Ðмƻ®¿´¿´Ôõô×ßµÄ
LZÇëÖØзÖÎöһϱíºÍ±àÒëË÷Òý£¬Èç¹ûÄãÊÇÔÚµ¼ÈëÊý¾ÝÇ°´´½¨µÄË÷ÒýÐÅÏ¢£¬»òÕßË÷ÒýʱºÜ¾ÃÒÔÇ°´´½¨µÄ£¬È»ºó³¢ÊÔÏÂһϷ½Ê½ÊÇ·ñºÃÓá£
Æä´Î£¬Çë³¢ÊÔһϼ¸ÖÖ·½Ê½£¬ÊÇ·ñ¿ÉÒÔÌá¸ßЧÂÊ
1¡¢¼ÙÈçÄã´´½¨µÄË÷ÒýÃû×Ö½Ð×ö:IDX_CONTRACT_CODE£¬ÄÇôÄãÕâÑù³¢ÊÔһϷ½·¨1£º
SQL code:
SELECT *
from (SELECT A.*, ROWNUM RN
from (SELECT /*+INDEX_ASC(t1,IDX_CONTRACT_CODE)*/*
from USERCONTRACT T1
ORDER BY CODE) A
WHERE ROWNUM <= 100)
WHERE RN >= 80
2¡¢·½·¨2£º
SQL cod
Ïà¹ØÎÊ´ð£º
ÎÒÊÇÓÃÔ¶³Ì×ÀÃæÁ¬²Ù×÷·þÎñÆ÷ÉϵÄÊý¾Ý¿â¡£
ÔÚ´´½¨Ò»¸öÓû§Ö®ºó£¬ÔÙÓÃPLSQLµÇ¼£¬ÔòPLSQLËÀµôÁË¡£
ÎҹصôPLSQLÖ®ºó£¬ÓÃÆäËûÓû§Ò²²»ÄܵǼ¡£
ÎÒ°ÑoracleµÄ·þÎñÍ£Ö¹£¬½á¹û¾ÍÊÇoracleµÄ·þÎñ״̬¾ÍÍ£ÁôÔÚ¡°Í ......
ÎÒÔÚ¿ª·¢µÄÕâ¸öÓ¦Óò¢·¢ÐԱȽϸߣ¬oracle¸üÐÂÊý¾ÝʱºòÈçºÎ´¦Àí²¢·¢´¦ÀíÄØ£¿¸÷λ´óÏÀ·¢±íºÃµÄ¹Ûµã°¡£¬ÔÚÏߵȴý£¡
oracleÊý¾Ý¸üÐÂʱ£¬»á×Ô¶¯Ä¬ÈÏÐÐËø¶¨£¬Â¥Ö÷²»Òª²ÙÐÄ£¬Oracle¶Ô²¢Ðд¦ÀíÒѾºÜ³ÉÊìÁË
ÒýÓÃ
oracle ......
ÈçÌ⣬ÔÚWINDOWSµ×ϵÄCODE»á£¬µ«ÔÚLINUXϲ»ÖªµÀÈçºÎʵÏÖ£¬JSµÄ´úÂëÓ¦¸ÃÊDz»Ò»ÑùµÄ¡£ Çó½Ì¡£
·Ö²»¹»ÔÙ¼Ó¡£
http://topic.csdn.net/u/20100113/08/17ba1e71-4c33-43f6-91a5-0e031c86e5ed.html
linux ......
ÇëÎÒÓÃFCKÉÏ´«Îļþ,ÔÚ±¾µØµÄwindows»úÉϲâÊÔ¿ÉÒÔ£¬µ«²¿Êðµ½linux·þÎñÆ÷ÉϾÍÉÏ´«²»ÁËÎļþ£¬ÉÏ´«Îļþʱһֱ¿¨ÔÚÄÇÀï¡£Íû¸÷λ´óϺָµã£¬Ð»Ð»£¡
·¹ý£¬°ïÄ㶥һÏ¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£
ÉÏ´«ÎļþµÄ·¾¶ÎÊÌ⣬ ......
oracle ͨ¹ýBDlink Á¬½Óµ½Ò»Ì¨MS SQL,²éѯ¶¼¿ÉÒÔ,µ«ÊDz»ÖªµÀÈçºÎÔÚoracleͨ¹ýDBLinkµ÷ÓÃMS SQLµÄ´æ´¢¹ý³Ì,Çó½â~лл~
ÒýÓÃ
oracle ͨ¹ýBDlink Á¬½Óµ½Ò»Ì¨MS SQL,²éѯ¶¼¿ÉÒÔ,µ«ÊDz»ÖªµÀÈçºÎÔÚoracleͨ¹ýDBLinkµ÷ÓÃM ......