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

ÔÚSQLÖÐʹÓÃnow()µ¼ÖµÄÐÔÄÜϽµ(MySQL)

×öÊý¾Ý¿âµ÷ÓÅ£¬Ò»¸ö¼òµ¥µÄtip¾ÍʹÐÔÄÜÌáÉýÒ»´ó¿éʱ£¬±»°ïÖúµÄÈË×ÔÈ»ÊǸßÐ˶øÇҸм¤£¬ÎÒÒ²ÊÇÂúÐÄ»¶Ï²¡£ÓÃËùѧ°ïÖúÁËËûÈË£¬Ò²ËµÃ÷»¹ÊÇÓÐÒ»¼¼Ö®³¤µÄ£¬ÓÐÒ»ÃÅÄܹ»Ñø»î×Ô¼ºµÄÊÖÒÕ¡£Ò²ËãÊÇÊÖÒÕÈ˰¡¡£
ͬÊÂÈÃÎÒ°ïÖúÓÅ»¯£¬ÔÚslow query logÀï·¢ÏÖÓÐÁ½¸öSQLÖ´ÐеĴÎÊý×î¶à£¬²¢ÇÒÿ´Î¶¼ÔÚÁ½ÃëÒÔÉÏ¡£ÓÃexplain¿´ÁË£¬Ò²Î´·¢ÏÖË÷ÒýʹÓ÷½ÃæµÄÎÊÌâ¡£
×îºó°Ñ»³ÒɵÄÄ¿¹âÂäÔÚÁËSQL½áβ´¦µÄ>=now()ÉÏ£¬now()ÿ´Î¶¼ÐèÒª´ÓϵͳÖÐÈ¡£¬Òò´Ë¿ÉÄܻᵼÖÂÎÞ·¨Ê¹ÓÃquery cache¡£
Á˽âÁËÒ»ÏÂÐèÇó£¬Êµ¼ÊÕâÀï²¢²»ÐèÒªµ±Ê±µÄʱ¿Ì£¬Ö»ÐèÒªµ±ÌìµÄÈÕÆÚ¾ÍÐÐÁË¡£Òò´Ë½¨ÒéͬʰÑ>=now()¸Ä³É>=µ±Ç°ÈÕÆÚ£¬¶øµ±Ç°ÈÕÆÚÔÚ³ÌÐòÖÐÈ¡µÃ¡£
¹ûÈ»£¬ÐÔÄÜ´ó·ùÌá¸ß¡£


Ïà¹ØÎĵµ£º

SQL ÁÙʱ±íÓëÁÙʱ±äÁ¿±í

 
         ÔÚSQLServerµÄÐÔÄܵ÷ÓÅÖУ¬ÓÐÒ»¸ö²»¿É±ÈÄâµÄÎÊÌ⣺ÄǾÍÊÇÈçºÎÔÚÒ»¶ÎÐèÒª³¤Ê±¼äµÄ´úÂë»ò±»Æµ·±µ÷ÓõĴúÂëÖд¦ÀíÁÙʱÊý¾Ý¼¯?±í±äÁ¿ºÍÁÙʱ±íÊÇÁ½ÖÖÑ¡Ôñ¡£ÈçºÎÈ·¶¨Ê²Ã´Ê±ºòÓÃÁÙʱ±í£¬Ê²Ã´Ê±ºòÓñí±äÁ¿ÄØ£¿ÁÙʱ±íºÍ±í±äÁ¿¶¼ÓÐÌØ¶¨µÄÊÊÓû·¾³¡£
¡¡¡¡±í±äÁ¿
¡¡¡¡±äÁ¿¶ ......

sql server²éѯÊý¾Ý¿âÖаüº¬Ö¸¶¨×Ö·û´®µÄÊý¾Ý±í

 ·¢²¼Ò»¸öʵÓÃС¹¤¾ß£¬¿ÉÒԺܷ½±ãµÄÔÚÊý¾Ý¿âÖÐÕÒµ½°üº¬Ö¸¶¨×Ö·û´®µÄÊý¾Ý±íÃû¼°ÏàÓ¦¼Ç¼£º
/*
¹¦ÄÜ£º²éѯÊý¾Ý¿âÖаüº¬Ö¸¶¨×Ö·û´®µÄÊý¾Ý±íÃû¼°ÏàÓ¦¼Ç¼
×÷Õߣº³Â¼ÓÅô chjpeng#163.com
ÈÕÆÚ£º2009-08-17
*/
declare @key varchar(30)
set @key = 'test'    --Ìæ»»ÎªÒª²éÕÒµÄ×Ö·û´®
DECLARE @ ......

SQLµ¼Èëµ¼³öExcelÊý¾Ý

 --´ÓExcelÎļþÖÐ,µ¼ÈëÊý¾Ýµ½SQLÊý¾Ý¿âÖÐ,ºÜ¼òµ¥,Ö±½ÓÓÃÏÂÃæµÄÓï¾ä:
/*===================================================================*/
--Èç¹û½ÓÊÜÊý¾Ýµ¼ÈëµÄ±íÒѾ­´æÔÚ
insert into ±í select * from
OPENROWSET('MICROSOFT.JET.OLEDB.4.0'
,'Excel 5.0;HDR=YES;DATABASE=c:\test.xls',sheet1$)
--Èç ......

sql server 2005°²×°¹ý³ÌÖÐÓöµ½µÄһЩÎÊÌâ

°²×°µÄ×é¼þºÍ°æ±¾µÄÐÅÏ¢
Microsoft SQL Server Management Studio      9.00.1399.00
Microsoft Analysis Services ¿Í»§¶Ë¹¤¾ß      2005.090.1399.00
Microsoft Êý¾Ý·ÃÎÊ×é¼þ (MDAC)      6.1.7600.16385 (win7_rtm.090713 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ