How to get the last created table in MySQL?

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

Many thanks

+3
source share
3 answers

You can choose the last create_timeone 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
+7
source

You can display from a specific database

SELECT *
FROM information_schema.TABLES
WHERE table_schema = 'database_name'
ORDER BY `TABLES`.`CREATE_TIME` DESC
+2
source

MySQL information_schema, , .

+1

Source: https://habr.com/ru/post/1724084/


All Articles