Ver data de ultimos registros MySQL

Mostra ultimos registros inseridos em cada tabela da database “sistema”


SELECT table_name, update_time FROM information_schema.tables WHERE table_schema = 'sistema';

Mostra data dos ultimos registros em todas databases no intervalo de 60 minutos


SELECT table_schema, table_name, update_time FROM information_schema.tables WHERE update_time > NOW() - INTERVAL 60 MINUTE;

Mostra data dos ultimos registros em todas databases no intervalo de 1 dia agrupadas pelo ultimo registro inserido em cada database:


SELECT table_schema, table_name, MAX(update_time) AS ut FROM information_schema.tables WHERE update_time > NOW() - INTERVAL 1 DAY GROUP BY table_schema ORDER BY ut;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s