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

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

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


Ïà¹ØÎĵµ£º

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

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

ÕûÀí±È½ÏÈ«µÄAccess SQL×¢Èë²Î¿¼

 Access SQL×¢Èë²Î¿¼
°æ±¾ 0.2.1
(×î½ü¸üР10/10/2007)
Ô­×÷Õß²»Ïê
 
ÃèÊö SQL²éѯ¼°×¢ÊÍ
×¢ÊÍ·û AccessÖÐûÓÐרÃŵÄ×¢ÊÍ·ûºÅ.Òò´Ë"/*", "--"ºÍ"#"¶¼Ã»·¨Ê¹ÓÃ.µ«ÊÇ¿ÉÒÔʹÓÿÕ×Ö·û"NULL"(%00)´úÌæ:
' UNION SELECT 1,1,1 from validTableName%00
 
Óï·¨´íÎóÐÅÏ¢ "[Microsoft][Driver ODBC Micros ......

SQLÖÐescapeµÄÖ÷ÒªÓÃ;

1.ʹÓà ESCAPE ¹Ø¼ü×Ö¶¨ÒåתÒå·û¡£ ÔÚģʽÖУ¬µ±×ªÒå·ûÖÃÓÚͨÅä·û֮ǰʱ£¬¸ÃͨÅä·û¾Í½âÊÍΪÆÕͨ×Ö·û¡£ÀýÈ磬ҪËÑË÷ÔÚÈÎÒâλÖðüº¬×Ö·û´® 5% µÄ×Ö·û´®£¬ÇëʹÓ㺠WHERE ColumnA LIKE '%5/%%' ESCAPE '/'
2.ESCAPE 'escape_character' ÔÊÐíÔÚ×Ö·û´®ÖÐËÑË÷ͨÅä·û¶ø²»Êǽ«Æä×÷ΪͨÅä·ûʹÓᣠescape_character ÊÇ·ÅÔÚͨÅä·ûÇ° ......

SQLÀúÊ·ÓëʵÏÖ

 
ÔÚ20ÊÀ¼Í70Äê´ú³õÆÚ£¬IBMÑо¿Ô±E. F. Codd²©Ê¿¿ª´´ÐÔµØÑо¿¿ª·¢Á˹ØϵÊý¾ÝÄ£ÐͲúÆ·SEQUEL£¬¼´½á¹¹»¯Ó¢Óï²éѯÓïÑÔ£¨Structured English Query Language£©¡£SEQUEL×îÖÕ±ä³ÉÁËSQL£¬»ò½á¹¹»¯²éѯÓïÑÔ£¨Structured Query Language£¬SQL£©¡£
IBM¼°ÆäËû¹ØϵÊý¾Ý¿âµÄ¿ª·¢³§É̶¼Ï£ÍûÓÐÒ»Ì×ÄÜ·ÃÎʲ¢²Ù×ݹØϵÊý¾Ý¿âµÄ±ê×¼»¯·½ ......

SQL Server

²éѯ card µÄ¼Ç¼ΪÁ½´ÎÒÔÉ쵀 card£¬¼Ç¼Êý:
select count(card), card from TableName group by card having count(card) > 1
¼¶Áª¸üУ¬¼¶ÁªÉ¾³ý:
ColumnName type not null constraint FK_Name foreign key(ColumnName) references PrimaryTable(ColumnName) on update/delete cascade
×Ô¶¯¼ÆËãÁÐ:
create tabl ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ