首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

怎么取得update了record的primary key id

2012-03-20 
如何取得update了record的primary key id?updatetestsetsex Mwherename johntable:idnamesex1johnF2mayM

如何取得update了record的primary key id?
update   test   set   sex= 'M '   where   name= 'john '

table:
id   name   sex
1     john   F
2     may     M
如何知道john这个record的id?谢谢

[解决办法]
select last_insert_id();

热点排行