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
You can display from a particular database
SELECT *
FROM information_schema.TABLES
WHERE table_schema = 'database_name'
ORDER BY `TABLES`.`CREATE_TIME` DESC
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With