Background:
I have a database table that for received_msgs
The table has two columns.
id, link_id
If the message is the first of them (based on criteria), then it link_idis equal to it id.
If it is a response to a message, it link_idis equal to the idmessage to which it replies.
Question:is there any way in the original insert to set link_idthe same as id?At the moment, I am doing an insertion and then doing another request, updating and setting link_idequalINSERT_ID
But I do not like to use two queries for it.
source
share