mysql同一表记录某一字段内容合并
mysql> create table t(id int,name varchar(20));
Query OK, 0 rows affected (0.09 sec)
mysql> insert into t values (1,'aa'),(1,'bb'),(2,'cc'),(2,'dd');
Query OK, 4 rows affected (0.00 sec)
Records: 4 Duplicates: 0 Warnings: 0
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from t;
+------+------+
| id | name |
+------+------+
| 1 | aa |
| 1 | bb |
| 2 | cc |
| 2 | dd |
+------+------+
4 rows in set (0.01 sec)
mysql> select id,GROUP_CONCAT(name) from t group by id;
+------+--------------------+
| id | GROUP_CONCAT(name) |
+------+--------------------+
| 1 | aa,bb |
| 2 | cc,dd |
+------+--------------------+
2 rows in set (0.00 sec)
相关文档:
主从服务器表类型的选择
一般的共识是主服务器使用innodb,事务,行锁等功能是myisam所没有的,对修改操作而言,它更高效;从服务器使用myisam,全文检索功能是innodb所没有的,对查询操作而言,它更高效。这样就可以各尽其能。
呵呵,主从库各司其职,主库:最快的速度做添加删除修改操作,从库,最快的速度做查询操作
......
转:http://home.mysql.cn/space-51084-do-blog-id-43.html
本文讨论 MySQL
的备份和恢复机制,以及如何维护数据表,包括最主要的两种表类型:MyISAM 和 Innodb,文中设计的 MySQL 版本为 5.0.22。
目前 MySQL
支持的免费备份工具有:mysqldump、mysqlhotcopy,还可以用 SQL 语法进行备份:BACKUP TABLE 或者 SELECT
......
mysql字符集设置和查询问题(转)
2010-04-14 11:33
MySQL的字符集支持(Character Set Support)有两个方面:
字符集(Character set)和排序方式(Collation)。
对于字符集的支持细化到四个层次:
服务器(server),数据库(database),数据表(table)和连接(connection) ......
MySQL EVENT
来源:http://samyu.blog.51cto.com/344284/146011
event_scheduler:
The MySQL event scheduler is a thread that runs in the background looking for events to execute. It spends a lot of time sleeping -- and won't do anything unless the new global variable "event_scheduler" is set t ......
首先:确定数据库的编码为utf8,正常储存中文(用MySQL-Front查看中文是否正常)
然后:Services查询MySQL时使用"SET NAMES 'utf8'",且通过"amfphp/browser"运行看看是否中文,如果乱码则修改gateway.php文件,去掉 $gateway->setCharsetHandler("utf8_decode", "ISO-8859-1", "ISO-8859-1");
最后:运行Flex程序显 ......