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
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
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
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.