z*y 发帖数: 1311 | 1 create table foo
{
id int auto_increment not null primary key,
value int;
}
insert into foo (value) values (16);
当插入这条记录后,如何读出它的id
谢谢 | i*****w 发帖数: 75 | 2 SELECT SCOPE_IDENTITY()
【在 z*y 的大作中提到】 : create table foo : { : id int auto_increment not null primary key, : value int; : } : insert into foo (value) values (16); : 当插入这条记录后,如何读出它的id : 谢谢
| f********t 发帖数: 117 | 3 either using return id after insert.
select curval ('seq name') |
|