oracleÖÐrownumºÍrowidµÄ²î±ð
oracle ÖÐ rownum ºÍ rowid µÄÇø±ð
ÔÚ Oracle Êý¾Ý¿âÖУ¬ROWNUM ºÍ ROWID ÊÇÁ½¸ö²î±ðµÄ¿´·¨£¬¸÷ÓÐÆäÓÃ;ºÍ¹¦Ð§£º
ROWNUM
½ç˵£º ROWNUM ÊÇÒ»¸öαÁУ¬Ëü·µ»Ø±íÖÐÿÐеıàºÅ£¬´Ó 1 ×îÏÈ¡£
ÓÃ;£º ROWNUM ͨ³£ÓÃÓÚÏÞÖÆЧ¹û¼¯ÖеÄÐÐÊý»ò·ÖÒ³ÅÌÎÊ¡£
ʾÀý£º
SELECT * FROM employees WHERE ROWNUM <p><strong>ROWID</strong></p>
µÇ¼ºó¸´ÖÆ
½ç˵£º ROWID ÊÇÒ»¸öÄÚ²¿±êʶ·û£¬ËüΨһ±êʶ±íÖеÄÿһÐС£
ÓÃ;£º ROWID Ö÷ÒªÓÃÓÚÄÚ²¿Ä¿µÄ£¬ÀýÈçË÷ÒýºÍÊý¾Ý¿éÖÎÀí¡£ËüÒ²¿ÉÓÃÓÚ»Ö¸´ÒÑɾ³ýµÄÐлòʶ±ð±íÖеÄÌض¨ÐС£
ʾÀý£º
SELECT ROWID FROM employees WHERE employee_id = 10; -- ·µ»ØÔ±¹¤ ID Ϊ 10 µÄÄÇÒ»ÐÐµÄ ROWID
µÇ¼ºó¸´ÖÆ
Òªº¦Çø±ð
¹¦Ð§£º ROWNUM ·µ»ØÐкţ¬¶ø ROWID ·µ»ØÐеÄÄÚ²¿±êʶ·û¡£
Á£¶È£º ROWNUM ¹ØÓÚÿ¸öÅÌÎÊÊÇΨһµÄ£¬¶ø ROWID ÔÚÕû¸öÊý¾Ý¿âÖж¼ÊÇΨһµÄ¡£
ÓÃ;£º ROWNUM ÓÃÓÚÏÞÖÆЧ¹û»ò·ÖÒ³£¬¶ø ROWID ÓÃÓÚÄÚ²¿Êý¾ÝÖÎÀí¡£
ÐÔÄÜ£º ROWNUM ¿ÉÄܻᵼÖ½ÏÂýµÄÅÌÎÊ£¬ÓÉÓÚ Oracle ±ØÐèΪÿ¸öÐÐÅÌËãÐкš£ROWID ͨ³£¾ßÓиüºÃµÄÐÔÄÜ£¬ÓÉÓÚËüÊÇÔ¤ÏÈÅÌËãµÄ¡£
ÒÔÉϾÍÊÇoracleÖÐrownumºÍrowidµÄ²î±ðµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡