3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

最近更新されたテーブルを知りたい場合のSQL文

Last updated at Posted at 2018-07-13

目的

「テーブルが多すぎて、どれが更新されたか分からないよ、ドラえもーん!」と叫びたくなった時に使える。

SQL文

SELECT
  `TABLE_NAME` as 'TABLE'
, `Update_time` as 'TIMESTAMP'
 from
  `information_schema`.`TABLES`
 WHERE
  TABLE_SCHEMA = '{DB名}'
 ORDER BY
  `Update_time` DESC;

※ {DB名}を適宜書き換えてね。

結果例

TABLE TIMESTAMP
user 2018-07-13 17:23:01
work 2018-07-13 17:22:59
list 2018-07-02 10:00:00
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?