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

MySQL ×Ö·û´®º¯Êý£º×Ö·û´®½ØÈ¡

 MySQL ×Ö·û´®½ØÈ¡º¯Êý£ºleft(), right(), substring(), substring_index()¡£»¹ÓÐ mid(), substr()¡£ÆäÖУ¬mid(), substr() µÈ¼ÛÓÚ substring() º¯Êý£¬substring() µÄ¹¦Äܷdz£Ç¿´óºÍÁé»î¡£
1. ×Ö·û´®½ØÈ¡£ºleft(str, length)
mysql> select left('sqlstudy.com', 3);
+-------------------------+
| left('sqlstudy.com', 3) |
+-------------------------+
| sql                     |
+-------------------------+
2. ×Ö·û´®½ØÈ¡£ºright(str, length)
mysql> select right('sqlstudy.com', 3);
+--------------------------+
| right('sqlstudy.com', 3) |
+--------------------------+
| com                      |
+--------------------------+
3. ×Ö·û´®½ØÈ¡£ºsubstring(str, pos); substring(str, pos, len)
3.1 ´Ó×Ö·û´®µÄµÚ 4 ¸ö×Ö·ûλÖÿªÊ¼È¡£¬Ö±µ½½áÊø¡£
mysql> select substring('sqlstudy.com', 4);
+------------------------------+
| substring('sqlstudy.com', 4) |
+------------------------------+
| study.com                    |
+------------------------------+
3.2 ´Ó×Ö·û´®µÄµÚ 4 ¸ö×Ö·ûλÖÿªÊ¼È¡£¬Ö»È¡ 2 ¸ö×Ö·û¡£
mysql> select substring('sqlstudy.com', 4, 2);
+---------------------------------+
| substring('sqlstudy.com', 4, 2) |
+---------------------------------+
| st                              |
+---------------------------------+
3.3 ´Ó×Ö·û´®µÄµÚ 4 ¸ö×Ö·ûλÖ㨵¹Êý£©¿ªÊ¼È¡£¬Ö±µ½½áÊø¡£
mysql> select substring('sqlstudy.com', -4);
+-------------------------------+
| substring('sqlstudy.com', -4) |
+-------------------------------+
| .com             &


Ïà¹ØÎĵµ£º

Java ¶ÁÈ¡ MySQL ÖÐÎÄ ÂÒÂë

Java ¶ÁÈ¡ MySQL ÖÐÎÄ ÂÒÂë
³¡¾°:Java,eclipse£¬¶ÁÈ¡MySQLÊý¾Ý¿â£¬MySQL±àÂëΪutf-8
ÎÊÌ⣺¶Á³öÀ´µÄÖÐÎÄÔÚeclipseµÄÊä³ö´°¿ÚÖÐÏÔʾΪÂÒÂë
´íÎóµÄд·¨
1
   System.out.print(new String( rs.getString("bib_author").getBytes("utf-8"),"GBK" )); 

   System.out.print( ......

mysqlÖ®ÄÚ´æ±í

 ÈçºÎ´´½¨ÄÚ´æ±í
£¿
    ´´½¨ÄÚ´æ±í·Ç³£µÄ¼òµ¥£¬Ö»Ðè×¢Ã÷ ENGINE=
MEMORY ¼´¿É:
    CREATE TABLE  `tablename` ( `columnName` varchar(256) NOT NUL)
ENGINE=MEMORY DEFAULT CHARSET=utf8 MAX_ROWS=100000000;
×¢Òâ
£º
   
µ±ÄÚ´æ±íÖеÄÊý¾Ý´óÓÚmax_ ......

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

×öÊý¾Ý¿âµ÷ÓÅ£¬Ò»¸ö¼òµ¥µÄtip¾ÍʹÐÔÄÜÌáÉýÒ»´ó¿éʱ£¬±»°ïÖúµÄÈË×ÔÈ»ÊǸßÐ˶øÇҸм¤£¬ÎÒÒ²ÊÇÂúÐÄ»¶Ï²¡£ÓÃËùѧ°ïÖúÁËËûÈË£¬Ò²ËµÃ÷»¹ÊÇÓÐÒ»¼¼Ö®³¤µÄ£¬ÓÐÒ»ÃÅÄܹ»Ñø»î×Ô¼ºµÄÊÖÒÕ¡£Ò²ËãÊÇÊÖÒÕÈË°¡¡£
ͬÊÂÈÃÎÒ°ïÖúÓÅ»¯£¬ÔÚslow query logÀï·¢ÏÖÓÐÁ½¸öSQLÖ´ÐеĴÎÊý×î¶à£¬²¢ÇÒÿ´Î¶¼ÔÚÁ½ÃëÒÔÉÏ¡£ÓÃexplain¿´ÁË£¬Ò²Î´·¢ÏÖË÷ÒýʹÓ÷ ......

ͨ¹ý·ÖÇø£¨Partition£©ÌáÉýMySQLÐÔÄÜ

 
ͨ¹ý·ÖÇø£¨Partition£©ÌáÉýMySQLÐÔÄÜ
×÷Õߣºfoxcai À´Ô´:foxcai µÄ Blog (2006-05-08 14:30:34)
ͨ¹ý·ÖÇø£¨Partition£©ÌáÉýMySQLÐÔÄÜ
               ——MySQL5.1ÐÂÌØÐÔ·­ÒëϵÁÐ
¼¸ÄêÇ°£¬°³Ð´¹ýһƪÌâΪ“The Founda ......

Ó°ÏìMysqlÐÔÄܵļ¸¸öÖØÒª²ÎÊý˵Ã÷

innodb_buffer_pool_size
Èç¹ûÓÃInnodb£¬ÄÇôÕâÊÇÒ»¸öÖØÒª±äÁ¿¡£Ïà¶ÔÓÚMyISAMÀ´Ëµ£¬Innodb¶ÔÓÚbuffer size¸üÃô¸Ð¡£MySIAM¿ÉÄܶÔÓÚ´óÊý¾ÝÁ¿Ê¹ÓÃĬÈϵÄkey_buffer_sizeÒ²»¹ºÃ£¬µ«InnodbÔÚ´óÊý¾ÝÁ¿Ê±ÓÃĬÈÏÖµ¾Í¸Ð¾õÔÚÅÀÁË¡£ InnodbµÄ»º³å³Ø»á»º´æÊý¾ÝºÍË÷Òý£¬ËùÒÔ²»ÐèÒª¸øϵͳµÄ»º´æÁô¿Õ¼ä£¬Èç¹ûÖ»ÓÃInnodb£¬¿ÉÒÔ°ÑÕâ¸öÖµÉèΪ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ