首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

Mysql存储过程遍历有关问题

2012-12-24 
Mysql存储过程遍历问题一张表user idnamegradetime1111null2012-12-012222null2012-12-023333null2012-12-

Mysql存储过程遍历问题
一张表user 
id  name  grade  time
1   111   null  2012-12-01
2   222   null  2012-12-02
3   333   null  2012-12-01

我根据时间比如2012-12-01,大于这个时间的都搜出来,然后将每个grade字段分别更新和name值一样的!

遍历不会!!!,求解~

[解决办法]
update user set grade = time where id in (select id from user where time > 2012-12-01)

热点排行
Bad Request.