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

SQLÖ´ÐÐ˳Ðò

Ò»¡¢sqlÓï¾äµÄÖ´Ðв½Ö裺
1£©Óï·¨·ÖÎö£¬·ÖÎöÓï¾äµÄÓï·¨ÊÇ·ñ·ûºÏ¹æ·¶£¬ºâÁ¿Óï¾äÖи÷±í´ïʽµÄÒâÒå¡£
2£© ÓïÒå·ÖÎö£¬¼ì²éÓï¾äÖÐÉæ¼°µÄËùÓÐÊý¾Ý¿â¶ÔÏóÊÇ·ñ´æÔÚ£¬ÇÒÓû§ÓÐÏàÓ¦µÄȨÏÞ¡£
3£©ÊÓͼת»»£¬½«Éæ¼°ÊÓͼµÄ²éѯÓï¾äת»»ÎªÏàÓ¦µÄ¶Ô»ù±í²éѯÓï¾ä¡£
4£©±í´ïʽת»»£¬ ½«¸´Ô SQL ±í´ïʽת»»Îª½Ï¼òµ¥µÄµÈЧÁ¬½Ó±í´ïʽ¡£
5£©Ñ¡ÔñÓÅ»¯Æ÷£¬²»Í¬µÄÓÅ»¯Æ÷Ò»°ã²úÉú²»Í¬µÄ“Ö´Ðмƻ®”
6£©Ñ¡ÔñÁ¬½Ó·½Ê½£¬ ORACLE ÓÐÈýÖÖÁ¬½Ó·½Ê½£¬¶Ô¶à±íÁ¬½Ó ORACLE ¿ÉÑ¡ÔñÊʵ±µÄÁ¬½Ó·½Ê½¡£
7£©Ñ¡ÔñÁ¬½Ó˳Ðò£¬ ¶Ô¶à±íÁ¬½Ó ORACLE Ñ¡ÔñÄÄÒ»¶Ô±íÏÈÁ¬½Ó£¬Ñ¡ÔñÕâÁ½±íÖÐÄĸö±í×öΪԴÊý¾Ý±í¡£
8£©Ñ¡ÔñÊý¾ÝµÄËÑË÷·¾¶£¬¸ù¾ÝÒÔÉÏÌõ¼þÑ¡ÔñºÏÊʵÄÊý¾ÝËÑË÷·¾¶£¬ÈçÊÇÑ¡ÓÃÈ«±íËÑË÷»¹ÊÇÀûÓÃË÷Òý»òÊÇÆäËûµÄ·½Ê½¡£
9£©ÔËÐГִÐмƻ®”
¶þ¡¢SQL SelectÓï¾äÍêÕûµÄÖ´ÐÐ˳Ðò£º
1¡¢from×Ó¾ä×é×°À´×Ô²»Í¬Êý¾ÝÔ´µÄÊý¾Ý£»
2¡¢where×Ó¾ä»ùÓÚÖ¸¶¨µÄÌõ¼þ¶Ô¼Ç¼ÐнøÐÐɸѡ£»
3¡¢group by×Ӿ佫Êý¾Ý»®·ÖΪ¶à¸ö·Ö×飻
4¡¢Ê¹Óþۼ¯º¯Êý½øÐмÆË㣻
5¡¢Ê¹ÓÃhaving×Ó¾äɸѡ·Ö×飻
6¡¢¼ÆËãËùÓеıí´ïʽ£»
7¡¢Ê¹ÓÃorder by¶Ô½á¹û¼¯½øÐÐÅÅÐò¡£
Èý¡¢oracle ¹²ÏíÔ­Àí£º
ORACLE½«Ö´ÐйýµÄSQLÓï¾ä´æ·ÅÔÚÄÚ´æµÄ¹²Ïí³Ø(shared buffer pool)ÖУ¬¿ÉÒÔ±»ËùÓеÄÊý¾Ý¿âÓû§¹²Ïí µ±ÄãÖ´ÐÐÒ»¸öSQLÓï¾ä(ÓÐʱ±»³ÆΪһ¸öÓαê)ʱ,Èç¹ûËüºÍ֮ǰµÄÖ´ÐйýµÄÓï¾äÍêÈ«Ïàͬ, ORACLE¾ÍÄܺܿì»ñµÃÒѾ­±»½âÎöµÄÓï¾äÒÔ¼°×îºÃµÄ Ö´Ðз¾¶. Õâ¸ö¹¦ÄÜ´ó´óµØÌá¸ßÁËSQLµÄÖ´ÐÐÐÔÄܲ¢½ÚÊ¡ÁËÄÚ´æµÄʹÓÃ
ËÄ¡¢oracle Óï¾äÌá¸ß²éѯЧÂʵķ½·¨£º
1£º where column in(select * from ... where ...);
2£º... where exists (select 'X' from ...where ...);
µÚ¶þÖÖ¸ñʽҪԶ±ÈµÚÒ»ÖÖ¸ñʽµÄЧÂʸߡ£ÔÚOracleÖпÉÒÔ¼¸ºõ½«ËùÓеÄIN²Ù×÷·û×Ó²éѯ¸ÄдΪʹÓÃEXISTSµÄ×Ó²éѯ ʹÓÃEXIST£¬Oracleϵͳ»áÊ×Ïȼì²éÖ÷²éѯ£¬È»ºóÔËÐÐ×Ó²éѯֱµ½ËüÕÒµ½µÚÒ»¸öÆ¥ÅäÏÕâ¾Í½ÚÊ¡ÁËʱ¼ä OracleϵͳÔÚÖ´ÐÐIN×Ó²éѯʱ£¬Ê×ÏÈÖ´ÐÐ×Ó²éѯ£¬²¢½«»ñµÃµÄ½á¹ûÁбí´æ·ÅÔÚÔÚÒ»¸ö¼ÓÁËË÷ÒýµÄÁÙʱ±íÖÐ ±ÜÃâʹÓÃhaving×Ö¾ä ±ÜÃâʹÓÃHAVING×Ó¾ä, HAVING Ö»»áÔÚ¼ìË÷³öËùÓмǼ֮ºó²Å¶Ô½á¹û¼¯½øÐйýÂË. Õâ¸ö´¦ÀíÐèÒªÅÅÐò,×ܼƵȲÙ×÷. Èç¹ûÄÜͨ¹ýWHERE×Ó¾äÏÞÖƼǼµÄÊýÄ¿,ÄǾÍÄܼõÉÙÕâ·½ÃæµÄ¿ªÏú¡£


Ïà¹ØÎĵµ£º

PL/SQL¿ª·¢Öж¯Ì¬SQLµÄʹÓ÷½·¨

ÄÚÈÝÕªÒª£ºÔÚPL/SQL¿ª·¢¹ý³ÌÖУ¬Ê¹ÓÃSQL£¬PL/SQL¿ÉÒÔʵÏִ󲿷ݵÄÐèÇ󣬵«ÊÇÔÚijЩÌØÊâµÄÇé¿öÏ£¬ÔÚPL/SQLÖÐʹÓñê×¼µÄSQLÓï¾ä»òDMLÓï¾ä²»ÄÜʵÏÖ×Ô¼ºµÄÐèÇ󣬱ÈÈçÐèÒª¶¯Ì¬½¨±í»òij¸ö²»È·¶¨µÄ²Ù×÷ÐèÒª¶¯Ì¬Ö´ÐС£Õâ¾ÍÐèҪʹÓö¯Ì¬SQLÀ´ÊµÏÖ¡£±¾ÎÄͨ¹ý¼¸¸öʵÀýÀ´ÏêϸµÄ½²½â¶¯Ì¬SQLµÄʹÓᣡ¡¡¡
¡¡¡¡±¾ÎÄÊÊÒ˶ÁÕß·¶Î§£ºOracle³ ......

½â¾öSQL ServerתACCESS×Ô¶¯±àºÅÎÊÌâ

1.´ò¿ªSQL server enterprise mananger "ÆóÒµ¹ÜÀíÆ÷"
ÔÚÄãÒªµ¼³öµÄ SQLÊý¾Ý¿âÉÏÊó±êÓÒ¼ü²Ëµ¥£ºËùÓÐÈÎÎñ-¡·µ¼³öÊý¾Ý

2.»Ø³öÏÖÒ»¸öµ¼³öÏòµ¼´°¿Ú¡£
Ñ¡Ôñ±»µ¼³öµÄÊý¾ÝÔ´£¬ÎªÄã¸Õ²ÅËùÑ¡ÔñµÄÊý¾Ý¿â£¬Èç¹û·¢ÏÖ²»¶ÔÓ¦×ÔÐÐÐ޸ġ£

3.½øÈëµ¼³öµ½Ä¿±êÊý¾ÝÔ´µÄÑ¡Ôñ£¬ÕâÀïÎÒÃÇҪת³ÉACCESSµÄÊý¾Ý¿â¡£×¢ÒâÑ¡ÔñÊý¾ÝÔ´ÀàÐÍΪ&ld ......

Oracleά»¤³£ÓÃSQLÓï¾ä»ã×Ü


¡¡ÈçºÎÔ¶³ÌÅжÏOracleÊý¾Ý¿âµÄ°²×°Æ½Ì¨
¡¡¡¡select * from v$version;
¡¡¡¡²é¿´±í¿Õ¼äµÄʹÓÃÇé¿ö
¡¡¡¡select sum(bytes)/(1024*1024) as free_space,tablespace_name
¡¡¡¡from dba_free_space
¡¡¡¡group by tablespace_name;
¡¡¡¡SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,
¡¡¡¡(B.BYTE ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ