INSERT into a(value) values ('test');
#set @last_id = LAST_INSERT_ID();
set @last_id = (select max(id) from a);
INSERT INTO b (a_id, `value`) values (@last_id, 'aaaa');
INSERT INTO b (a_id, `value`) values (@last_id, 'tetete');

INSERT into a(value) values ('bbbtest');
set @last_id = (select max(id) from a);
INSERT INTO b (a_id, `value`) values (@last_id, 'aaaa');
INSERT INTO b (a_id, `value`) values (@last_id, 'tetete');

相关文章:

  • 2022-12-23
  • 2021-06-15
  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2022-01-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
相关资源
相似解决方案