Use data newly inserted in Postgresql

0

Good day! I tell them what I want to do, this is the application cycle.

What I need to do is starting from the user id ( id_user ) obtained in a query I do, delete in the table " user_status " the row where that id_user matches and insert in " user_history " a new row using the " id_user " of my query.

When creating the new row in " user_history " it generates a " id_status ".

Having already the new row with that id_status and the one already obtained id_user , I have to generate a new row in " user_status ".

What is the problem? How to do to use a data newly created in the insert of another query.

Greetings!

    
asked by JuanManuel245 04.07.2018 в 14:30
source

0 answers