读书人

怎么取得update了record的primary key

发布时间: 2012-03-20 14:01:10 作者: rapoo

如何取得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();

读书人网 >Mysql

热点推荐