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

¡¾×ª¡¿ÈçºÎ²é¿´oracle sqlÖ´Ðмƻ®

·½·¨Ò»
µÚÒ»²½£ºµÇÈësql/plus Ö´ÐÐÃüÁÎÞÏȺó˳Ðò£©
set   time   on; (˵Ã÷£º´ò¿ªÊ±¼äÏÔʾ£©  
  set   autotrace   on; (˵Ã÷£º´ò¿ª×Ô¶¯·ÖÎöͳ¼Æ£¬²¢ÏÔʾSQLÓï¾äµÄÔËÐнá¹û£©  
  set   autotrace   traceonly; (˵Ã÷£º´ò¿ª×Ô¶¯·ÖÎöͳ¼Æ£¬²»ÏÔʾSQLÓï¾äµÄÔËÐнá¹û£©
¶þÕßÑ¡Ò»¸öÖ´ÐÐ
µÚ¶þ²½£º ÊäÈëÄãÒª²é¿´µÄsql Ö´ÐÐ
µÚÈý²½£º²é¿´½á¹û Èçͼ £¨Í¼Ôõôմ²»ÉÏ°¡£©
·½·¨¶þ
ÏÈÖ´ÐÐ EXPLAIN PLAN FOR   select * from G_GAMBLING gamb where gamb.active=1
ÔÙ select * from table(DBMS_XPLAN.DISPLAY)±ã¿ÉÒÔ¿´µ½oracleµÄÖ´Ðмƻ®ÁË
Ô­ÎĵØÖ·£ºhttp://blog.csdn.net/e3002/archive/2007/09/10/1778821.aspx


Ïà¹ØÎĵµ£º

SQL TRUNCATE TABLEµÄÓ÷¨

ÓÐʱºòÎÒÃÇ»áÐèÒªÇå³ýÒ»¸ö±í¸ñÖеÄËùÓÐ×ÊÁÏ¡£Òª´ïµ½Õ߸öÄ¿µÄ£¬Ò»ÖÖ·½Ê½ÊÇÎÒÃÇÔÚ SQL DROP ÄÇÒ»Ò³ ¿´µ½µÄ DROP TABLE Ö¸Áî¡£²»¹ýÕâÑùÕû¸ö±í¸ñ¾ÍÏûʧ£¬¶øÎÞ·¨ÔÙ±»ÓÃÁË¡£ÁíÒ»ÖÖ·½Ê½¾ÍÊÇÔËÓà TRUNCATE TABLE µÄÖ¸Áî¡£ÔÚÕâ¸öÖ¸Áî֮ϣ¬±í¸ñÖеÄ×ÊÁÏ»áÍêÈ«Ïûʧ£¬¿ÉÊDZí¸ñ±¾Éí»á¼ÌÐø´æÔÚ¡£ TRUNCATE TABLE µÄÓ﷨ΪÏ£º
TRUNCATE ......

SQL¾ä·¨µÄÓ¦ÓÃ

ÔÚÕâÒ»Ò³ÖУ¬ÎÒÃÇÁгöËùÓÐÔÚÕâ¸öÍøÕ¾ÓÐÁгö SQL Ö¸ÁîµÄÓï·¨¡£ÈôÒª¸üÏ꾡µÄ˵Ã÷£¬ÇëµãÑ¡Ö¸ÁîÃû³Æ¡£
ÕâÒ»Ò³µÄÄ¿µÄÊÇÌṩһ¸ö¼ò½àµÄ SQL Óï·¨×öΪ¶ÁÕ߲ο¼Ö®Óá£ÎÒÃǽ¨ÒéÄúÏÖÔھͰ´ Control-D ½«±¾Ò³¼ÓÈëÄúµÄ¡ºÎÒµÄ×î°®¡»¡£
Select
SELECT "À¸Î»" from "±í¸ñÃû"
Distinct
SELECT DISTINCT "À¸Î»"
from "±í¸ñÃû"
......

OracleÎﻯÊÓͼ

OracleµÄÎﻯÊÓͼÌṩÁËÇ¿´óµÄ¹¦ÄÜ£¬¿ÉÒÔÓÃÓÚÔ¤ÏȼÆËã²¢±£´æ±íÁ¬½Ó»ò¾Û¼¯µÈºÄʱ½Ï¶àµÄ²Ù×÷µÄ½á¹û£¬ÕâÑù£¬ÔÚÖ´Ðвéѯʱ£¬¾Í¿ÉÒÔ±ÜÃâ½øÐÐÕâЩºÄʱµÄ²Ù×÷£¬¶ø´Ó¿ìËٵĵõ½½á¹û¡£ÎﻯÊÓͼÓкܶ෽ÃæºÍË÷ÒýºÜÏàËÆ£ºÊ¹ÓÃÎﻯÊÓͼµÄÄ¿µÄÊÇΪÁËÌá¸ß²éѯÐÔÄÜ£»ÎﻯÊÓͼ¶ÔÓ¦ÓÃ͸Ã÷£¬Ôö¼ÓºÍɾ³ýÎﻯÊÓͼ²»»áÓ°ÏìÓ¦ÓóÌÐòÖÐSQLÓï¾äµÄÕýÈ ......

sql server¸ß¼¶²éѯ


1)  ͳ¼Æ¸÷¸öϵµÄѧÉúÐÅÏ¢
select count(Sname) ×ÜÈËÊý,Sdept from Student group by Sdept
2)  ²éѯÐŹÜϵѧÉúµÄ×î´óÄêÁäºÍ×îСÄêÁä
select MAX(Sage) ×î´óÄêÁä,MIN(Sage) ×îСÄêÁä from Student where
Sdept='ÐŹÜϵ'
3)  ²éѯÐŹÜϵ×î´óÄêÁäºÍ×îСÄêÁäµÄѧÉúµÄÐÕÃû
  select Sname from St ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ