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

ORACLEÖв鿴SQLÖ´Ðмƻ®µÄ·½·¨

 1.Ê×ÏÈÐèÒª½¨Á¢plan table,·ñÔò²»ÄÜʹÓÃ
½¨Á¢·½·¨£º
$oracle\rdbms\adminÏÂÓиö
utlxplan.sql
ÆäÄÚÈÝΪ:
create table PLAN_TABLE (
 statement_id  varchar2(30),
 timestamp     date,
 remarks       varchar2(80),
 operation     varchar2(30),
 options        varchar2(255),
 object_node   varchar2(128),
 object_owner  varchar2(30),
 object_name   varchar2(30),
 object_instance numeric,
 object_type     varchar2(30),
 optimizer       varchar2(255),
 search_columns  number,
 id  numeric,
 parent_id numeric,
 position numeric,
 cost  numeric,
 cardinality numeric,
 bytes  numeric,
 other_tag       varchar2(255),
 partition_start varchar2(255),
        partition_stop  varchar2(255),
        partition_id    numeric,
 other  long,
 distribution    varchar2(30),
 cpu_cost numeric,
 io_cost  numeric,
 temp_space numeric,
        access_predicates varchar2(4000),
        filter_predicates varchar2(4000));
ÔËÐдËSQL
SQL>$ORACLE/rdbms/admin/utlxplan.sql
2.ʹÓÃexplain plan forÓï¾ä½øÐÐÖ´Ðмƻ®·ÖÎö
SQL> explain plan for
  2  select * from dual;
ÒѽâÊÍ¡£
³öÏÖÉÏÊö½á¹û£¬±íÃ÷·ÖÎöÍê±Ï£¬¿ÉÒԲ鿴
3.¿ÉÒԲ鿴ִÐмƻ®ÁË
select * from table(DBMS_XPLAN.display);
--------------------------------------------------------------------
| Id  | Operation            |  Name    


Ïà¹ØÎĵµ£º

SQL ServerϵͳÊÓͼ


--> Title  : SQL ServerϵͳÊÓͼ
--> Author : wufeng4552
--> Date   : 2009-10-28
 
Ŀ¼ÊÓͼ
Ŀ¼ÊÓͼ·µ»Ø SQL Server Êý¾Ý¿âÒýÇæʹÓõÄÐÅÏ¢¡£½¨ÒéÄúʹÓÃĿ¼ÊÓͼÕâÒ»×î³£ÓõÄĿ¼ԪÊý¾Ý½çÃ棬Ëü¿ÉΪÄúÌṩ×îÓÐЧµÄ·½·¨À´»ñÈ¡¡¢×ª»»²¢ÏÔʾ´ËÐÅÏ¢µÄ×Ô¶¨ÒåÐÎʽ¡£ËùÓÐÓû§¿ÉÓÃĿ¼Ԫ ......

sql serverÖÐinºÍexistsµÄСÇø±ð oracleδ²âÊÔ

in µÄ»°£¬ Èç¹ûÊÇnull ¾Í²»±È½ÏÁË£¬¼È²»ÊÇin Ò²²»ÊÇ not in
existsµÄ»° ÒòΪÓà = ¼ÓÔÚÌõ¼þÀï±È½ÏÁË£¬ËùÒÔ null ÊÇ not exists
select *
from pricetemp
where cast(ÉÌÆ·¥³ー¥É as varchar(10))not in(
           select shohin_cd
  &nbs ......

SQL ServerÖеÄͨÅä·û

ͨÅä·û_
"_"ºÅ±íʾÈÎÒâµ¥¸ö×Ö·û,¸Ã·ûºÅÖ»ÄÜÆ¥ÅäÒ»¸ö×Ö·û."_"¿ÉÒÔ·ÅÔÚ²éѯÌõ¼þµÄÈÎÒâλÖÃ,ÇÒÖ»ÄÜ´ú±íÒ»¸ö×Ö·û.Ò»¸öºº×ÖֻʹÓÃÒ»¸ö"_"±íʾ.
Àý×Ó£º
if PATINDEX('%[ß¹-×ö]%','ÐèÒªÅжϵÄ×Ö·û')>0 -- ÅжÏÊÇ·ñÓÐ×Ö·û
print 'Óкº×Ö'
else
print 'ÎÞºº×Ö'
ͨÅä·û%
"%"·ûºÅÊÇ×Ö·ûÆ¥Åä·û,ÄÜÆ¥Åä0¸ö»ò¸ü¶à×Ö·ûµÄÈÎÒⳤ¶ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ