tags:

views:

23

answers:

2

Hi,

I have a MySQL database and every 6 months, a new table is created with the latest entries. What SQL command can get you the latest created table in a database?

Many thanks

+5  A: 

You can select the last create_time from information_schema.TABLES.

For example:

select table_name, create_time 
from information_schema.TABLES
where table_schema = 'andomar'
order by CREATE_TIME desc
limit 1
Andomar
A: 

MySQL stores this info in the information_schema database, so you'll be able to get the info from there i you have access to it.

Nicky De Maeyer