如何在MySQL中获取最新创建的表? [英] How to get the latest created table in MySQL?

查看:121
本文介绍了如何在MySQL中获取最新创建的表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MySQL数据库,每6个月将创建一个包含最新条目的新表.哪些SQL命令可以为您提供数据库中最新创建的表?

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?

非常感谢

推荐答案

您可以从information_schema.TABLES中选择最后一个create_time.

You can select the last create_time from information_schema.TABLES.

例如:

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

这篇关于如何在MySQL中获取最新创建的表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆