Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL: find out what date a row was added to a table?

Tags:

mysql

I added a new column to a table called price_request_date because I now need to track the date each one was made. I made it so new ones enter the current date when they insert a new row. I was just wondering if there was any way to fill in the previous rows with the dates they were entered? I don't know if MySQL keeps track of that sort of thing or not, but worth an ask. Thanks!

like image 358
JD Isaacks Avatar asked Jun 02 '09 18:06

JD Isaacks


2 Answers

There is not. There is no way to automatically backdate a timestamp field with the original creation date if it weren't already set at creation time.

Frustrating - I know.

like image 196
William Edmondson Avatar answered Nov 15 '22 22:11

William Edmondson


nope. it is good to always include LastChgID and LastChgDate on tables like this, do that next time from the get go...

like image 26
KM. Avatar answered Nov 15 '22 21:11

KM.