Answer the question
In order to leave comments, you need to log in
How to insert the last ID from another table into a field?
I do this INSERT:
INSERT INTO galaxy (name, type, diametr FLOAT, mass, discovery_date, birth_date FLOAT, astronomical_object ) VALUES (...)
Answer the question
In order to leave comments, you need to log in
INSERT INTO galaxy (name, type, diametr FLOAT, mass, discovery_date, birth_date FLOAT,
astronomical_object )
VALUES (..., (SELECT MAX('id') FROM astronomical_object))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question