I have a record in a table called PARAMETRI
that has an autoincrement field named idparametri
. What I want to do is save a record in a table called OBRA
; that table has a field called PARAMETRI_ID_PARAMETRI
and I want to make a record when I save the maximum value of ID_PARAMETRI
in PARAMETRI_ID_PARAMETRI
which is the work id, but at the same time I want to insert the other fields in the table OBRA
Here the maximum value of the auto increment is inserted into the table OBRA
INSERT INTO OBRA (PARAMETRI_ID_PARAMETRI) SELECT MAX(PARAMETRI.ID_PARAMETRI) FROM PARAMETRI;
How do I insert the maximum value of the auto increment and other parameters in the OBRA
table that are NOMBRE_O
, DIRECCIÓN
and VALOR
I hope you can help me.