Hi guys , I have 3 tables with auto generated incremental ids.
This is what I would like to achieve:
INSERT INTO mqtt_connection (broker_ip,broker_port,broker_user,broker_pass, topic)
VALUES('mqtt.controller.com.ar','83','pmmc','pmmc1234','topic-seed')
INSERT INTO rtu (rtu_id, connection_id, mac, client_id_mosquitto, service_status) VALUES('rtussltest',select max(id) from mqtt_connection,'b827eb8ec0c3','saraza1234saraza5678','active');
INSERT INTO user (user_id, connection_id, rtu_id, client_id_mosquitto, user_name, user_pass, service_status)
VALUES('usuario00001',select max(id) from mqtt_connection,select max(id) from rtu,'saraza4321saraza8765','ssl_user ','1234','active' )
the
select max(id) from mqtt_connection,select max(id) from rtu
is the sentense that does not work.
Is there some way to get the last generated ids from table to insert in another table ?
Regards;
Leandro.