Dilli Babu Kadati
Dilli Babu Kadati

Reputation: 169

Is there any way to get list of tables by created on date.?

i found some answers but i found some answers here: Get the list of tables created on any date? but im getting, sys.tables doesn't exists. i know here sys is database name.

Upvotes: 0

Views: 701

Answers (2)

FanoFN
FanoFN

Reputation: 7124

Look into tables table in information_schema db. Query below:

SELECT table_schema,table_name,create_time 
FROM   information_schema.tables
WHERE  table_schema=*your_database_name
AND    table_name=*your_table_name;

Replace *your_database_name and *your_table_name accordingly.

Edit: sorry, your question is to lookup by created date.. here's the query:

SELECT table_schema,table_name,create_time 
FROM   information_schema.tables
WHERE  DATE(create_time)="yyyy-mm-dd"

You can try it here : https://www.db-fiddle.com/f/n1yPjJKhyMLkWSP25htovn/0

Upvotes: 2

Sudhir Ojha
Sudhir Ojha

Reputation: 3305

If you want to find by a particular created date then:

 SELECT * FROM information_schema.tables where TABLE_SCHEMA = 'YOUR_DATABASE_NAME' 
 AND CREATE_TIME = '2019-12-23 17:41:05'

Upvotes: 2

Related Questions