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

MySqlÈÕÆÚ¸ñʽ»¯

DATE_FORMAT(date,format)
¸ù¾Ýformat×Ö·û´®¸ñʽ»¯dateÖµ¡£ÏÂÁÐÐÞÊηû¿ÉÒÔ±»ÓÃÔÚformat×Ö·û´®ÖУº %M ÔÂÃû×Ö(January……December)
%W
ÐÇÆÚÃû×Ö(Sunday……Saturday)
%D ÓÐÓ¢Óïǰ׺µÄÔ·ݵÄÈÕÆÚ(1st, 2nd, 3rd, µÈµÈ¡££©
%Y Äê, Êý×Ö, 4 λ
%y Äê, Êý×Ö, 2 λ
%a ËõдµÄÐÇÆÚÃû×Ö(Sun……Sat)
%d Ô·ÝÖеÄÌìÊý, Êý×Ö(00……31)
%e
Ô·ÝÖеÄÌìÊý, Êý×Ö(0……31)
%m ÔÂ, Êý×Ö(01……12)
%c ÔÂ, Êý×Ö(1……12)
%b
ËõдµÄÔ·ÝÃû×Ö(Jan……Dec)
%j Ò»ÄêÖеÄÌìÊý(001……366)
%H Сʱ(00……23)
%k Сʱ(0……23)
%h Сʱ(01……12)
%I Сʱ(01……12)
%l Сʱ(1……12)
%i ·ÖÖÓ, Êý×Ö(00……59)
%r ʱ¼ä,12 Сʱ(hh:mm:ss [AP]M)
%T ʱ¼ä,24 Сʱ(hh:mm:ss)
%S Ãë(00……59)
%s Ãë(00……59)
%p AM»òPM
%w Ò»¸öÐÇÆÚÖеÄÌìÊý(0=Sunday ……6=Saturday £©
%U
ÐÇÆÚ(0……52), ÕâÀïÐÇÆÚÌìÊÇÐÇÆڵĵÚÒ»Ìì
%u ÐÇÆÚ(0……52), ÕâÀïÐÇÆÚÒ»ÊÇÐÇÆڵĵÚÒ»Ìì
%% Ò»¸öÎÄ×Ö“%”¡£
%a - ÐÇÆÚ¼¸µÄ¼òд
%A - ÐÇÆÚ¼¸µÄȫд
%b - Ô·ݵļòд
%B - Ô·ݵÄȫд
%c
- ÈÕÆÚʱ¼ä06/12/05 11:15:10
%C - ÊÀ¼Íʱ¼ä
%d - Ò»¸öÔµĵڼ¸ºÅ(´Ó 01 µ½ 31)
%D - ͬ
%m/%d/%y
%e - Ò»¸öÔµĵڼ¸ºÅ£¬ºÅΪµ¥ÊýÔòÇ°Ãæ¼ÓÒ»¿Õ¸ñ (´Ó 1 µ½ 31)
%g - ÊÀ¼Í
%G - ÊÀ¼Í
[0000,9999]
%h - ͬ%b
%H - 24СʱÐÎʽµÄСʱ(´Ó00µ½23)
%I - 12СʱÐÎʽµÄСʱ(´Ó01µ½ 12)
%j - Ò»ÄêÖеĵڼ¸Ìì(´Ó 001 µ½ 366)
%k - 24СʱÐÎʽµÄСʱ£¬µ¥Êý×ÖÇ°Ãæ¼Ó¿Õ¸ñ. (´Ó 0 µ½ 23)
%l -
12СʱÐÎʽµÄСʱ£¬µ¥Êý×ÖÇ°Ãæ¼Ó¿Õ¸ñ.(range 1 to 12)
%m - ÔÂ·Ý (range 01 to 12)
%M - ·Ö
%n - »»Ðзû
%p - ÏÔʾÔçÉÏ»¹ÊÇÏÂÎç`am' »ò `pm'
%r - a.m. »ò p.m.ÐÎʽµÄʱ¼ä
%R -
24СʱÐÎʽµÄʱ¼ä
%S - Ãë
%t - tab·ûºÅ
%T - ͬ%H:%M:%S
%u - Óà [1,7],±íʾÐÇÆÚ¼¸
%U - ¼ÆËãÊǸÃÄêµÄµÚ¼¸¸öÐÇÆÚ£¬´Ó¸ÃÄêµÄµÚÒ»¸öÐÇÆÚÌ쿪ʼ¼ÆËã
%V - ¼ÆËãÊǸÃÄêµÄµÚ¼¸¸öÐÇÆÚ, ´Ó 01 µ½ 53,
µÚÒ»¸öÐÇÆÚ±ØÐëÖÁÉÙÓÐ4ÌìÔÚÕâÒ»Äê, ÐÇÆÚÌì×÷ΪÕâ¸öÐÇÆڵĵÚÒ»


Ïà¹ØÎĵµ£º

¸ßÐÔÄÜMySQLѧϰ±Ê¼Ç(¶þ)

 Ç°×ºË÷Òý
(1)Èç¹ûÒÔ¶à¸ö×Ö¶Î×÷ΪË÷Òý£¨a,b£¬c)×÷Ϊһ¸ökey,ÔÚ²éѯʱ·Ö¸ù¾ÝÆ¥ÅäÇé¿öÊÇ·ñʹÓÃË÷Òý£¬ËùÒÔ£¬a/ a,b/ a,b,cÕâÑùµÄ²éѯ¶¼ÄÜʹÓõ½£¬µ«ÊÇb,a/a,c/c,aµÈ²»·û֪ǰ׺ƥÅä¾Í²»ÄÜʹÓã¬ËùÒÔÔÚдsqlʱÐèҪעÒâ
(2)¶ÔÓںܳ¤µÄ×Ö·û´®ÐèÒªÉú³Ékeyʱ£¬¿ÉÒÔÕÒ³ö×ʹÓõÄ×Ö·û´®µÄ×î³£¼ûǰ׺(Ç°N¸ö×ÖÌõ×÷Ϊkey,¶ø²»Êǽ ......

MySql²Ù×÷Àà

×î½üдÁËÒ»¸ö¼òµ¥µÄMysql²Ù×÷À࣬ÄóöÀ´ºÍ´ó¼Ò·ÖÏíһϣ¬»¹Çë¸÷λ¸ßÊÖÖ¸ÕýÒ»ÏÂÎö¹¹º¯ÊýµÄÓ÷¨£º
<?php
/*
* Created on 2010-5-25
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*
* class mysql
* made by S71ENCE
*/
class mysql ......

MySql ±íµÄÖ÷¼üË÷ÒýÎÊÌâ

²é¿´Ä³¸ö±íµÄ½¨±íÓï¾ä £ºshow create table data_statdata;
drop index ts on data_statdata;
Ë÷ÒýÊǼÓËÙ²éѯµÄÖ÷ÒªÊֶΣ¬Ìرð¶ÔÓÚÉæ¼°¶à¸ö±íµÄ²éѯ¸üÊÇÈç´Ë¡£±¾½ÚÖУ¬½«½éÉÜË÷ÒýµÄ×÷Óá¢Ìص㣬ÒÔ¼°´´½¨ºÍɾ³ýË÷ÒýµÄÓï·¨¡£
13.4.1 ʹÓÃË÷ÒýÓÅ»¯²éѯ
Ë÷ÒýÊÇ¿ìËÙ¶¨Î»Êý¾ÝµÄ¼¼Êõ£¬Ê×ÏÈͨ¹ýÒ»¸öʾÀýÀ´Á˽âÆ京Òå¼°×÷Óã ......

mysqlÖ÷´ÓÊý¾Ý¿â²Ù×÷

Ö÷£º
show master status;
+-----------------+------------+-------------------+-----------------------+
| File                |
Position     | Binlog_Do_DB   | Binlog_Ignore_DB |
+------------ ......

OracleµÄNVL()º¯ÊýºÍMySQLÖеÄIfNull()º¯Êý

MS SQL ÖеÄIsNull()º¯Êý£º
IsNull ( check_expression , replacement_expression )
check_expression: ¿ÉÒÔÊÇÈκÎÀàÐÍ,½«Òª¼ì²éµÄ±í´ïʽ  ²»Îª¿Õ£¬·µ»ØËü
replacement_expression: ÀàÐͱØÐëºÍcheck_expressionÏàͬ£¬check_expressionΪnull£¬·µ»ØËü
Õâ¸öº¯ÊýµÄ×÷ÓþÍÊÇ£ºÅжÏcheck_expressionÊÇ·ñΪ¿Õ£¬Îª¿Õ¾Í·µ» ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ