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

ÅäËÍÒѵ½»õ¶©µ¥ºÅ²éѯ sql Óï¾äÓÅ»¯

select c0501 "¶©µ¥±àºÅ",
   c0503 "¹©Ó¦É̱àÂë",a0302 "¹©Ó¦ÉÌÃû³Æ",
   to_char(c0515,'yyyy.mm.dd') "¶©»õÈÕÆÚ",
   to_char(c0516,'yyyy.mm.dd') "Ô¤¶¨½»»õÈÕÆÚ"
   from c05,a03 where c0503=a0301 and
   c0502='01' and to_char(c0515,'yyyy.mm.dd')
   between '2009.02.01' and '2009.02.28' and c0523='4'
SELECT STATEMENT, GOAL = CHOOSE            Cost=500    Cardinality=1059   
Bytes=69894
 HASH JOIN            Cost=500    Cardinality=1059    Bytes=69894
  TABLE ACCESS FULL    Object owner=FZDC    Object name=C05    Cost=486   
Cardinality=23    Bytes=667
  TABLE ACCESS FULL    Object owner=FZDC    Object name=A03    Cost=13    Cardinality=15193   
Bytes=562141
-------------------------1.75
-------------------------1.75
-------------------------1.75
    create index IND_C05_C0515 on c05(c0515)
    analyze table c05 compute statistics
select c0501 "¶©µ¥±àºÅ",
   c0503 "¹©Ó¦É̱àÂë",a0302 "¹©Ó¦ÉÌÃû³Æ",
   to_char(c0515,'yyyy.mm.dd') "¶©»õÈÕÆÚ",
   to_char(c0516,'yyyy.mm.dd') "Ô¤¶¨½»»õÈÕÆÚ"
   from c05,a03 where c0503=a0301 and
   c0502='01' and c0515
   between to_date('2009.02.01','yyyy-mm-dd') and to_date('2009.02.28','yyyy-mm-dd')
    and c0523='4'
  SQL Statement from editor:
  
  
   select c0501 "¶©µ¥±àºÅ",
     c0503 "¹©Ó¦É̱àÂë",a0302 "¹©Ó¦ÉÌÃû³Æ",
     to_ch


Ïà¹ØÎĵµ£º

·ÀSQLÊý×Ö×¢È뺯Êý

·ÀSQLÊý×Ö×¢È뺯Êý
http://blog.csdn.net/cncco/archive/2007/10/03/1810540.aspx
·ÀSQL×¢È뺯Êý
³ÌÐò´úÂ룺
º¯Êý²¿·Ö========================================================================
'------------------------------------------------
'ÓÃ;:¼ì²éÊÇ·ñΪÊý×Ö,ÒÔ¼°Êý×ÖÊÇ·ñ³¬³ö·¶Î§
'ÊäÈë:¼ì²é×Ö·û,´ ......

v$sql,v$sqlarea,v$sqltextÓÐʲôÇø±ð

v$sqltext
´æ´¢µÄÊÇÍêÕûµÄSQL
v$sqlarea
´æ´¢µÄSQL ºÍһЩÏà¹ØµÄÐÅÏ¢£¬±ÈÈçÀۼƵÄÖ´ÐдÎÊý£¬Âß¼­¶Á£¬ÎïÀí¶ÁµÈͳ¼ÆÐÅÏ¢
v$sql
´æ´¢µÄÊǾßÌåµÄSQL ºÍÖ´Ðмƻ®Ïà¹ØÐÅÏ¢£¬Êµ¼ÊÉÏ£¬v$sqlarea ¿ÉÒÔ¿´×ö v$sql ¸ù¾Ý sqltext µÈ ×öÁË group by Ö®ºóµÄÐÅÏ¢ ......

sqlÓï¾ä

/*»ñÈ¡Öظ´¼Ç¼ÖнÏСµÄÄǸöID*/ create table tmp_Repeat as  select  min(id) as id from poi group by idcode having count(*) >1; /*±¸·Ýɾ³ýµÄÊý¾Ý*/ select * from poi where id in (select id from tmp_repeat) /*ɾ³ýÖظ´¼Ç¼ÖÐID½ÏСµÄÄÇÌõ
select replace('°¢¹ðÊǸöºÃº¢×Ó','°¢¹ð','СÏÍ') from du ......

ÓÃSQLÈ¥³ý±íÖÐijÁеÄIdentiferÊôÐÔ

sp_configure 'allow updates', 1
GO
reconfigure with override
GO
update syscolumns set colstat = colstat & 0x0000
where id=object_id('±íÃû') and name='ÁÐÃû'
GO
sp_configure 'allow updates', 0  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ