Last update table MySQL

1

Good morning.

I have a procedure that runs daily deleting the data of a table with daily data of the clients of my system and for data availability reasons, sometimes this procedure is executed sooner or later.

I would like to know if there is a query that visualizes the date of the last update of a table so that I can use it in PHP to show users the last update performed inside the system (table).

Is it possible?

Thank you!

I tested it and it returns a value of null .

  

Note that this table does not accumulate data, it is deleted and receives data insert of the day in question.

Maybe I did not put the question well.

Is it possible?

    
asked by anonymous 06.09.2016 / 16:31

2 answers

1

This way:

SELECT
    UPDATE_TIME as ultima_atualizacao
FROM
    information_schema.tables
WHERE
    TABLE_NAME = 'nome_da_tabela'
AND
    TABLE_SCHEMA = 'nome_do_banco';
    
06.09.2016 / 16:37
0

All changes are written to the mysql information_schema so use something similar to this query

SELECT UPDATE_TIME, TABLE_SCHEMA, TABLE_NAME
FROM information_schema.tables
ORDER BY UPDATE_TIME DESC, TABLE_SCHEMA, TABLE_NAME

On top of it, you edit for what you need

    
06.09.2016 / 16:38