请问一句 mysql语句 把mysql数据库内一个字段year(int)下的所有内容都加1,请问sql语句怎样写? 要求不嵌套.谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 mysql> create table testadd(id int not null,year int not null);Query OK, 0 rows affected (0.03 sec)mysql> select * from testadd;Empty set (0.00 sec)mysql> insert into testadd values (1,2009),(2,2008);Query OK, 2 rows affected (0.02 sec)Records: 2 Duplicates: 0 Warnings: 0mysql> select * from testadd;+----+------+| id | year |+----+------+| 1 | 2009 || 2 | 2008 |+----+------+2 rows in set (0.00 sec)mysql> update testadd set year=year+1;Query OK, 2 rows affected (0.01 sec)Rows matched: 2 Changed: 2 Warnings: 0mysql> select * from testadd;+----+------+| id | year |+----+------+| 1 | 2010 || 2 | 2009 |+----+------+2 rows in set (0.00 sec)mysql> update table set year=year+1;2楼真强悍 访问统计项目求思路指导 2008年的计划,走PHP的路 php SQL语句怎么只读取当天信息!! php 关于获取网页里面的特定信息 如何获得某个表的外键关系 求一技巧性问题 请问有没有方法判断一个request是否是从其它站点或页面用meta http-equiv="refresh"重定向过来的? 今天超级郁闷 在线等:php中更新数据库中某一记录的语句是什么,是否需要像插入记录那样将所有字段全部填入啊 请问如何能看到"127.0.0.1"下的目录与文件 帮我写一个PHP 的记录集并且可以循环5次的代码吧!我是初学者!请最好有注释! 求教,多级分类中类别深度问题
Query OK, 0 rows affected (0.03 sec)mysql> select * from testadd;
Empty set (0.00 sec)
mysql> insert into testadd values (1,2009),(2,2008);
Query OK, 2 rows affected (0.02 sec)
Records: 2 Duplicates: 0 Warnings: 0mysql> select * from testadd;
+----+------+
| id | year |
+----+------+
| 1 | 2009 |
| 2 | 2008 |
+----+------+
2 rows in set (0.00 sec)mysql> update testadd set year=year+1;
Query OK, 2 rows affected (0.01 sec)
Rows matched: 2 Changed: 2 Warnings: 0mysql> select * from testadd;
+----+------+
| id | year |
+----+------+
| 1 | 2010 |
| 2 | 2009 |
+----+------+
2 rows in set (0.00 sec)mysql>
2楼真强悍