ÅäËÍÒѵ½»õ¶©µ¥ºÅ²éѯ 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 Server²éѯһÕűíµÄËùÓÐ×ֶΣº
http://hi.baidu.com/samxx8/blog/item/7048f8de1725835894ee37b4.html
SELECT c.name,o.name from syscolumns AS c
INNER JOIN sysobjects AS o
ON c.id = o.id where o.name='SPF_Users' ......
ÔÚÈí¼þ¿ª·¢ÖУ¬³£³£ÐèҪΪ³ÌÐò½¨Á¢Sql ServerÊý¾Ý¿âµÄÔËÐл·¾³¡£Íê³ÉÈçÔÚSQL ServerÊý¾Ý¿âÖн¨Á¢É豸£¬½¨Á¢Êý¾Ý¿â£¬½¨Á¢±í¸ñ£¬·ÖÅäȨÏ޵ȹ¦ÄÜ£¬ÈçºÎ·½±ãµÄ½¨Á¢Ó¦ÓóÌÐòËùÐèSql Server»·¾³µÄÊý¾Ý¿â»·¾³£¬¶ø²»ÓÃÆô¶¯SQL Enterprise ManagerÄØ£¿
ÏÂÃæÀ´¿´£º
¡¡¡¡Æô¶¯VB6.0£¬Ð½¨Ò»¸ö¹¤ ......
v$sqltext
´æ´¢µÄÊÇÍêÕûµÄSQL
v$sqlarea
´æ´¢µÄSQL ºÍһЩÏà¹ØµÄÐÅÏ¢£¬±ÈÈçÀۼƵÄÖ´ÐдÎÊý£¬Âß¼¶Á£¬ÎïÀí¶ÁµÈͳ¼ÆÐÅÏ¢
v$sql
´æ´¢µÄÊǾßÌåµÄSQL ºÍÖ´Ðмƻ®Ïà¹ØÐÅÏ¢£¬Êµ¼ÊÉÏ£¬v$sqlarea ¿ÉÒÔ¿´×ö v$sql ¸ù¾Ý sqltext µÈ ×öÁË group by Ö®ºóµÄÐÅÏ¢ ......
ͨ³££¬ÄãÐèÒª»ñµÃµ±Ç°ÈÕÆںͼÆËãһЩÆäËûµÄÈÕÆÚ£¬ÀýÈ磬ÄãµÄ³ÌÐò¿ÉÄÜÐèÒªÅжÏÒ»¸öÔµĵÚÒ»Ìì»òÕß×îºóÒ»Ìì¡£´ó²¿·ÖÈË´ó¸Å¶¼ÖªµÀÔõÑù°ÑÈÕÆÚ½øÐзָÄê¡¢Ô¡¢Èյȣ©£¬È»ºó½ö½öÓ÷ָî³öÀ´µÄÄê¡¢Ô¡¢ÈյȷÅÔÚ¼¸¸öº¯ÊýÖмÆËã³ö×Ô¼ºËùÐèÒªµÄÈÕÆÚ£¡ÔÚÕâƪÎÄÕÂÀÎÒ½«½ÌÄãÈçºÎʹÓÃDATEADDºÍDATEDIFFº¯ÊýÀ´¼ÆËã³öÔÚÄãµÄ³ÌÐòÖпÉÄÜÄ ......
/*»ñÈ¡Öظ´¼Ç¼ÖнÏСµÄÄǸö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 ......