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

MysqlµÄ×Ö·û´®º¯Êý

Ç°×¢£º¶ÔÓÚÕë¶Ô×Ö·û´®Î»ÖõIJÙ×÷£¬µÚÒ»¸öλÖñ»±ê¼ÇΪ1¡£
ASCII(str) ·µ»Ø×Ö·û´®strµÄ×î×óÃæ×Ö·ûµÄASCII´úÂëÖµ¡£Èç¹ûstrÊÇ¿Õ×Ö·û´®£¬·µ»Ø0¡£Èç¹ûstrÊÇNULL£¬·µ»ØNULL¡£
mysql> select ASCII('2');
-> 50
mysql> select ASCII(2);
-> 50
mysql> select ASCII('dx');
-> 100
Ò²¿É²Î¼ûORD()º¯Êý¡£
ORD(str) Èç¹û×Ö·û´®str×î×óÃæ×Ö·ûÊÇÒ»¸ö¶à×Ö½Ú×Ö·û£¬Í¨¹ýÒÔ¸ñʽ((first byte ASCII code)*256+(second byte ASCII code))[*256+third byte ASCII code...]·µ»Ø×Ö·ûµÄASCII´úÂëÖµÀ´·µ»Ø¶à×Ö½Ú×Ö·û´úÂë¡£Èç¹û×î×óÃæµÄ×Ö·û²»ÊÇÒ»¸ö¶à×Ö½Ú×Ö·û¡£·µ»ØÓëASCII()º¯Êý·µ»ØµÄÏàֵͬ¡£
mysql> select ORD('2');
-> 50

CONV(N,from_base,to_base) ÔÚ²»Í¬µÄÊý×Ö»ùÖ®¼ä±ä»»Êý×Ö¡£·µ»ØÊý×ÖNµÄ×Ö·û´®Êý×Ö£¬´Ófrom_base»ù±ä»»Îªto_base»ù£¬Èç¹ûÈκβÎÊýÊÇNULL£¬·µ»ØNULL¡£²ÎÊýN½âÊÍΪһ¸öÕûÊý£¬µ«ÊÇ¿ÉÒÔÖ¸¶¨ÎªÒ»¸öÕûÊý»òÒ»¸ö×Ö·û´®¡£×îС»ùÊÇ2ÇÒ×î´óµÄ»ùÊÇ36¡£Èç¹ûto_baseÊÇÒ»¸ö¸ºÊý£¬N±»ÈÏΪÊÇÒ»¸öÓзûºÅÊý£¬·ñÔò£¬N±»µ±×÷ÎÞ·ûºÅÊý¡£ CONVÒÔ64λµã¾«¶È¹¤×÷¡£
mysql> select CONV("a",16,2);
-> '1010'
mysql> select CONV("6E",18,8);
-> '172'
mysql> select CONV(-17,10,-18);
-> '-H'
mysql> select CONV(10+"10"+'10'+0xa,10,10);
-> '40'

BIN(N) ·µ»Ø¶þ½øÖÆÖµNµÄÒ»¸ö×Ö·û´®±íʾ£¬ÔÚ´ËNÊÇÒ»¸ö³¤ÕûÊý(BIGINT)Êý×Ö£¬ÕâµÈ¼ÛÓÚCONV(N,10,2)¡£Èç¹ûNÊÇNULL£¬·µ»ØNULL¡£
mysql> select BIN(12);
-> '1100'
OCT(N) ·µ»Ø°Ë½øÖÆÖµNµÄÒ»¸ö×Ö·û´®µÄ±íʾ£¬ÔÚ´ËNÊÇÒ»¸ö³¤ÕûÐÍÊý×Ö£¬ÕâµÈ¼ÛÓÚCONV(N,10,8)¡£Èç¹ûNÊÇNULL£¬·µ»ØNULL¡£
mysql> select OCT(12);
-> '14'

HEX(N) ·µ»ØÊ®Áù½øÖÆÖµNÒ»¸ö×Ö·û´®µÄ±íʾ£¬ÔÚ´ËNÊÇÒ»¸ö³¤ÕûÐÍ(BIGINT)Êý×Ö£¬ÕâµÈ¼ÛÓÚCONV(N,10,16)¡£Èç¹ûNÊÇNULL£¬·µ»ØNULL¡£
mysql> select HEX(255);
-> 'FF'

CHAR(N,...) CHAR()½«²ÎÊý½âÊÍΪÕûÊý²¢ÇÒ·µ»ØÓÉÕâЩÕûÊýµÄASCII´úÂë×Ö·û×é³ÉµÄÒ»¸ö×Ö·û´®¡£NULLÖµ±»Ìø¹ý¡£
mysql> select CHAR(77,121,83,81,'76');
-> 'MySQL'
mysql> select CHAR(77,77.3,'77.3');
-> 'MMM'

CONCAT(str1,str2,...) ·µ»ØÀ´×ÔÓÚ²ÎÊýÁ¬½áµÄ×Ö·û´®¡£Èç¹ûÈκβÎÊýÊÇNULL£¬·µ»ØNULL¡£¿ÉÒÔÓг¬¹ý


Ïà¹ØÎĵµ£º

mysql ÖÐÊýѧº¯ÊýµÄʹÓÃ

ËùÓеÄÊýѧº¯ÊýÔÚÒ»¸ö³ö´íµÄÇé¿öÏ·µ»ØNULL¡£ 

µ¥Ä¿¼õ¡£¸Ä±ä²ÎÊýµÄ·ûºÅ¡£ 
mysql> select - 2; 
×¢Ò⣬Èç¹ûÕâ¸ö²Ù×÷·ûÓëÒ»¸öBIGINTʹÓ㬷µ»ØÖµÊÇÒ»¸öBIGINT£¡ÕâÒâζ×ÅÄãÓ¦¸Ã±ÜÃâÔÚÕûÊýÉÏʹÓÃ-£¬ÄÇ¿ÉÄÜÓÐÖµ-2^63£¡ 
ABS(X) 
·µ»ØXµÄ¾ø¶ÔÖµ¡£ 
mysql ......

mysql µ¼Èëµ¼³ö


1.CMDÃüÁîÐÐÏÂÇл»µ½ mysql°²×°Ä¿Â¼ÏµÄbinĿ¼
ÀýÈç:cd D:\program\study\mysql\bin>
2. D:\program\study\mysql\bin> mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > sqlÎļþ´æ·Å·¾¶ºÍÃû³Æ
D:\program\study\mysql\bin>mysqldump -u root -p oa > D:\oa.sql
3.ÊäÈëÃÜÂë
4.ÉÔ΢µÈ´ýƬ¿Ì(Êý¾Ý¿â½Ï´óµÈ´ýʱ¼ä¿ÉÄ ......

ÈçºÎͨ¹ýPHP½«excelµÄÊý¾Ýµ¼ÈëMySQLÖÐ

  ÈçºÎͨ¹ýPHP½«excelµÄÊý¾Ýµ¼ÈëMySQLÖÐ
    ÔÚ¿ª·¢PHP³ÌÐòʱ£¬ºÜ¶àʱºòÎÒÃÇ»áÓн«Êý¾ÝÅúÁ¿µ¼ÈëÊý¾Ý¿âµÄÐèÇó£¬ÈçѧÉúÐÅÏ¢ÅúÁ¿Ìí¼Óµ½Êý¾Ý¿âÖУ¬¶øÊÂÏÈÓÃexcel±àÅźã¬¶ÔexcelʵÐвÙ×÷£¬±ãÊÇÎÒÃDZȽϳ£ÓõÄÑ¡Ôñ·½Ê½¡£
     ÔÚ¶ÔexcelµÄ²Ù×÷ÖУ¬phpExcelReade±ãÊǺܶàÈ˵Ĺ²Í¬ ......

MySQL ¶à¼¶²éѯ

ÐèÇó1£ºÔÚÒ»¸öselect ²éѯ¼¯ÖÐÔٴβéѯ
SELECT * from (SELECT field from table) AS alias
ÐèҪעÒâºóÃæµÄalias£¬ÔÚmysqlÖУ¬ÕâÊDZØÐëµÄ
ÐèÇó2£ºÒ»¸ö²éѯ¼¯µÄ½á¹û²»ÔÚÁíÒ»¸ö²éѯ¼¯ÖÐ
SELECT feild1 from table1 WHERE feild1 NOT IN (SELECT field2 from table2)
ÐèҪעÒ⣬ӦÓÃIN/NOT IN×Ó¾äʱ£¬±ØÐëÖ¸¶¨²éѯ×Ö¶ÎÃû£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ