mysql插入与主键相同值的另一个字段

来源:互联网 发布:linux服务器重启 编辑:程序博客网 时间:2024/05/29 02:30
insert into users(username,password) values((select auto_increment from information_schema.tables where table_schema ='mytest' and table_name='users'),'123456' );select * from information_schema.tables where table_schema ='mytest' and table_name='users';
INSERT menu (id,name,url,parent_id,`order`) VALUES((select AUTO_INCREMENT from information_schema.tables where  table_name='menu'),'1','4','1',`id`);
阅读全文
0 0
原创粉丝点击