这个sql语句要怎么写啊? 方法1, 将表数据导出成文本,删除表数据,文本替换后重新导回去。方法2,写脚本逐条纪录更新。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 mysql> use test;Database changedmysql> create table aa(id int not null auto_increment primary key,name varchar(20));Query OK, 0 rows affected (0.13 sec)mysql> insert into aa values(1,'社会新闻'),(2,'国际新闻');Query OK, 2 rows affected (0.08 sec)Records: 2 Duplicates: 0 Warnings: 0mysql> select * from aa;+----+----------+| id | name |+----+----------+| 1 | 社会新闻 || 2 | 国际新闻 |+----+----------+2 rows in set (0.00 sec)mysql> update aa set name=replace(name,'新闻','时事');Query OK, 2 rows affected (0.03 sec)Rows matched: 2 Changed: 2 Warnings: 0mysql> select * from aa;+----+----------+| id | name |+----+----------+| 1 | 社会时事 || 2 | 国际时事 |+----+----------+2 rows in set (0.00 sec) mysql 导入数据乱码 清晰明了的高难度SQL,请教高手。 group by 优化问题 存储过程加返回值 如何使用mysql_ping命令? sql,怎么使一条记录排到最后!! 请问mySQL是大型数据库吗? 一个关于SQL的问题,请大家帮帮忙,先谢谢了!!!! 有没有人用过mysql to access demo? 为什么使用mysql索引之后速度下降了80%? EMS SQL Manager 2005 for MySQL 如何支持UTF8 急!!!请高手帮忙,在线等
Database changed
mysql> create table aa(id int not null auto_increment primary key,name varchar(2
0));
Query OK, 0 rows affected (0.13 sec)mysql> insert into aa values(1,'社会新闻'),(2,'国际新闻');
Query OK, 2 rows affected (0.08 sec)
Records: 2 Duplicates: 0 Warnings: 0mysql> select * from aa;
+----+----------+
| id | name |
+----+----------+
| 1 | 社会新闻 |
| 2 | 国际新闻 |
+----+----------+
2 rows in set (0.00 sec)mysql> update aa set name=replace(name,'新闻','时事');
Query OK, 2 rows affected (0.03 sec)
Rows matched: 2 Changed: 2 Warnings: 0mysql> select * from aa;
+----+----------+
| id | name |
+----+----------+
| 1 | 社会时事 |
| 2 | 国际时事 |
+----+----------+
2 rows in set (0.00 sec)