Hi All,
Is there any way using which I can get the last row I have updated of the table.
For Ex:- my table has 1000 records in it. I have updated the value of 500th record of table X. So, I want the ID 500 in return.
Thanks in advance.
Regards,
Hi All,
Is there any way using which I can get the last row I have updated of the table.
For Ex:- my table has 1000 records in it. I have updated the value of 500th record of table X. So, I want the ID 500 in return.
Thanks in advance.
Regards,
I don't think this feature exists with MySQL. However you can get the same effect by adding a timestamp column:
ALTER TABLE yourtable
ADD COLUMN last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
This would make the last_update column pretty much automatically maintained. Now you can select from yourtable the last updated row based on the timestamp.