SQLÓï¾äÓÅ»¯·½·¨30Àý
ÔÚSQLÓï¾äÓÅ»¯¹ý³ÌÖУ¬ÎÒÃǾ³£»áÓõ½hint,ÏÖ×ܽáÒ»ÏÂÔÚSQLÓÅ»¯¹ý³ÌÖг£¼ûOracle
HINTµÄÓ÷¨£º
1. /*+ALL_ROWS*/
±íÃ÷¶ÔÓï¾ä¿éÑ¡Ôñ»ùÓÚ¿ªÏúµÄÓÅ»¯·½·¨,²¢»ñµÃ×î¼ÑÍÌÍÂÁ¿,ʹ×ÊÔ´ÏûºÄ×îС»¯.
ÀýÈç:
SELECT /*+ALL+_ROWS*/ EMP_NO,EMP_NAM,DAT_IN from BSEMPMS WHERE EMP_NO='SCOTT'; 2. /*+FIRST_ROWS*/
±íÃ÷¶ÔÓï¾ä¿éÑ¡Ôñ»ùÓÚ¿ªÏúµÄÓÅ»¯·½·¨,²¢»ñµÃ×î¼ÑÏìӦʱ¼ä,ʹ×ÊÔ´ÏûºÄ×îС»¯.
ÀýÈç:
SELECT /*+FIRST_ROWS*/ EMP_NO,EMP_NAM,DAT_IN from BSEMPMS WHERE EMP_NO='SCOTT';
3. /*+CHOOSE*/
±íÃ÷Èç¹ûÊý¾Ý×ÖµäÖÐÓзÃÎʱíµÄͳ¼ÆÐÅÏ¢,½«»ùÓÚ¿ªÏúµÄÓÅ»¯·½·¨,²¢»ñµÃ×î¼ÑµÄÍÌÍÂ
Á¿;
±íÃ÷Èç¹ûÊý¾Ý×ÖµäÖÐûÓзÃÎʱíµÄͳ¼ÆÐÅÏ¢,½«»ùÓÚ¹æÔò¿ªÏúµÄÓÅ»¯·½·¨;
ÀýÈç:
SELECT /*+CHOOSE*/ EMP_NO,EMP_NAM,DAT_IN from BSEMPMS WHERE EMP_NO='SCOTT';
4. /*+RULE*/
±íÃ÷¶ÔÓï¾ä¿éÑ¡Ôñ»ùÓÚ¹æÔòµÄÓÅ»¯·½·¨.
ÀýÈç:
SELECT /*+ RULE */ EMP_NO,EMP_NAM,DAT_IN from BSEMPMS WHERE EMP_NO='SCOTT';
5. /*+FULL(TABLE)*/
±íÃ÷¶Ô±íÑ¡ÔñÈ«¾ÖɨÃèµÄ·½·¨.
ÀýÈç:
SELECT /*+FULL(A)*/ EMP_NO,EMP_NAM from BSEMPMS A WHERE EMP_NO='SCOTT';
6. /*+ROWID(TABLE)*/
ÌáʾÃ÷È·±íÃ÷¶ÔÖ¸¶¨±í¸ù¾ÝROWID½øÐзÃÎÊ.
ÀýÈç:
SELECT /*+ROWID(BSEMPMS)*/ * from BSEMPMS WHERE ROWID>='AAAAAAAAAAAAAA'
AND EMP_NO='SCOTT';
7. /*+CLUSTER(TABLE)*/
ÌáʾÃ÷È·±íÃ÷¶ÔÖ¸¶¨±íÑ¡Ôñ´ØɨÃèµÄ·ÃÎÊ·½·¨,ËüÖ»¶Ô´Ø¶ÔÏóÓÐЧ.
ÀýÈç:
SELECT /*+CLUSTER */ BSEMPMS.EMP_NO,DPT_NO from BSEMPMS,BSDPTMS WHERE DPT_NO='TEC304' AND BSEMPMS.DPT_NO=BSDPTMS.DPT_NO;
8. /*+INDEX(TABLE INDEX_NAME)*/
±íÃ÷¶Ô±íÑ¡ÔñË÷ÒýµÄɨÃè·½·¨.
ÀýÈç:
SELECT /*+INDEX(BSEMPMS SEX_INDEX) USE SEX_INDEX BECAUSE THERE ARE FEWMALE BSEMPMS */ from BSEMPMS WHERE SEX='M';
9. /*+INDEX_ASC(TABLE INDEX_NAME)*/
±íÃ÷¶Ô±íÑ¡ÔñË÷ÒýÉýÐòµÄɨÃè·½·¨.
ÀýÈç:
SELECT /*+INDEX_ASC(BSEMPMS PK_BSEMPMS) */ from BSEMPMS WHERE DPT_NO='SCOTT';
10. /*+INDEX_COMBINE*/
Ϊָ¶¨±íÑ¡Ôñλͼ·ÃÎÊ·¾,Èç¹ûINDEX_COMBINEÖÐûÓÐÌṩ×÷Ϊ²ÎÊýµÄË÷Òý,½«Ñ¡Ôñ³ö
λͼË÷ÒýµÄ²¼¶û×éºÏ·½Ê½.
ÀýÈç:
SELECT /*+INDEX_COMBINE(BSEMPMS SAL_BMI HIREDATE_BMI)*/ * from BSEMPMS WHERE SAL <5000000 AND HIREDATE <SYSDATE;
11. /*+INDEX_JOIN(TABLE INDEX_NAME)*/
Ïà¹ØÎĵµ£º
Æô¶¯SQL Server (SQLEXPRESS)·þÎñʱÌáʾ´íÎó£¬Ê¼þ²é¿´Æ÷ÏÔʾÒÔÏÂÐÅÏ¢£¨ID 9003£©£º
´«µÝ¸øÊý¾Ý¿â 'master' ÖеÄÈÕ־ɨÃè²Ù×÷µÄÈÕ־ɨÃèºÅ (276:232:1) ÎÞЧ¡£´Ë´íÎó¿ÉÄÜָʾÊý¾ÝË𻵣¬»òÕßÈÕÖ¾Îļþ(.ldf)ÓëÊý¾ÝÎļþ(.mdf)²»Æ¥Åä¡£Èç¹û´Ë´íÎóÊÇÔÚ¸´ÖÆÆÚ¼ä³öÏֵģ¬ÇëÖØд´½¨·¢²¼¡£·ñÔò£¬Èç¹û¸ÃÎÊÌâµ¼ÖÂÆô¶¯ÆÚ¼ä³ö´í£¬Çë´Ó± ......
*
ÌṩÁ½ÖÖ°æ±¾µÄOutLookÓʼþ·¢ËÍ·½Ê½
ÓÐÒÉÎÊÁªÏµ×÷Õß: zlp321001@hotmail.com
*/
A:ÀûÓÃOutLook2003·¢ËÍÓʼþ
----------------------------------------------------------------------
/
*²âÊÔ»·¾³: windowx Xp
OutLook: OutLook 2003
²âÊԵĵç×ÓÓʼþ: zlp321001@126.com
/
µÚÒ»²½Ö裺½¨ÅäÖÃÎļþ
......
HO~HO~EXCELÉú³ÉSQL½¨±í´æ´¢¹ý³ÌµÄVBA½Å±¾^_^ÔÞÒ»ÏÂ
2007-12-11 10:39
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ È«¾Ö±äÁ¿¶¨Òå
Const MAX_COLUMN_NUM = 50
Dim stOutputPath As String
Dim stOutputFile As String
Dim stDBName As String
Dim stUserName As String
Dim stUserPasswd As ......
°´Ö¸¶¨´ÎÊýÖظ´×Ö·û±í´ïʽ¡£
Óï·¨
REPLICATE ( character_expression, integer_expression)
²ÎÊý
character_expression
×Ö·ûÊý¾ÝÐ͵Ä×ÖĸÊý×Ö±í´ïʽ£¬»òÕß¿ÉÒÔÒþʽת»»Îª nvarchar »ò ntext µÄÆäËûÊý¾ÝÀàÐ͵Ä×ÖĸÊý×Ö±í´ïʽ¡£
integer_expression
¿ÉÒÔÒþʽת»»Îª int µÄ±í´ïʽ¡£Èç¹û integer_expression Ϊ ......