As from title, I would like to return last row inserted/updated fields and values, is it possible in the same INSERT and the UPDATE query?
As from title, I would like to return last row inserted/updated fields and values,
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you use primary key, you can use LAST_INSERT_ID(); for example:
If you need to get all row recently inserted or updated, I sugest to add INSERTED and UPDATED field with date time data type. So you can select your table with recently interval. See sample bellow:
this will return last one minute modified or inserted record.