Home  >  Article  >  Database  >  mysql 请教大神关于插入自增id问题

mysql 请教大神关于插入自增id问题

WBOY
WBOYOriginal
2016-06-06 09:42:071034browse

mysql

mysql : insert into A(name,age,coun) values('小王','10','XXX+本条自增id');
insert into B(class) value('test');
insert into C(AId,BId) values('AId','BId');
执行三条插入语句;

问题来了:1、“XXX+本条自增id” XX为字符串 ;
2、'AId','BId' 分别为上面前两条插入语句的id;
具体怎么写,SELECT LAST_INSERT_ID()、SHOW TABLE STATUS 如何嵌套使用,请指点,鞠躬感谢!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn