MySQL Forums
Forum List  »  Newbie

Re: use max(id) from table to insert in other table
Posted by: Jesús Uzcanga
Date: May 15, 2018 10:08AM

You must enclose your subquery in parenthesis.

INSERT INTO rtu (rtu_id, connection_id, mac, client_id_mosquitto, service_status) VALUES('rtussltest',(select max(id) from mqtt_connection),'b827eb8ec0c3','saraza1234saraza5678','active');

___________________________
Ing. Jesús Alfredo Uzcanga
Twitter: @JesusUzcanga

We learn the 20% of what we HEAR,
the 50% of what we SEE,
the 80% of what we DO and
the 95% of what we TEACH.

____________________________________________________________
https://www.linkedin.com/in/jauzcanga/

Options: ReplyQuote


Subject
Written By
Posted
Re: use max(id) from table to insert in other table
May 15, 2018 10:08AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.