MySQL Forums
Forum List  »  Newbie

TIMESTAMPDIFF Format
Posted by: Alan Crookes
Date: November 24, 2010 06:21PM

I have the following query and am trying to work out how old the current table is based on the UPDATE_TIME field of the INFORMATION_SCHEMA Table.

I am using the following query:

SELECT INFORMATION_SCHEMA.TABLES.TABLE_NAME, TIMESTAMPDIFF(HOUR,INFORMATION_SCHEMA.TABLES.UPDATE_TIME,NOW()) FROM INFORMATION_SCHEMA.TABLES WHERE INFORMATION_SCHEMA.TABLES.TABLE_SCHEMA LIKE 'TABLE_NAME'

I have specified the TIMESTAMPDIFF at the moment as HOUR but I want it to be displayed in Minutes, then Hours, then Days as it gets older if you understand.
i.e. 59 mins old, 1 hour old, 3 hours old, 1 day 5 hours old and so on...

Any help would be appreciated.

Thanks,

Alan.

Options: ReplyQuote


Subject
Written By
Posted
TIMESTAMPDIFF Format
November 24, 2010 06:21PM
November 25, 2010 01:55AM
November 25, 2010 07:05AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.