数据库查询某个数据库有多少张表 表插入数据的时间

Oracle:

select count(*) from user_tables;

MySQL:

SELECT table_schema AS 库名,COUNT(*) AS 表数量 FROM information_schema.TABLES WHERE table_schema = '查询数据库名' GROUP BY table_schema ;

说明

:information_schema是mysql自带的数据库,存放着如数据库名、表明、权限的信息,TABLES存放的是表的信息。

SQL server:

select count(*) from sysobjects where xtype='U';

表里数据插入时间 月度统计

SELECT count(*), date_format(create_time, '%Y-%m') AS `日期`
FROM ims_room_site
GROUP BY date_format(create_time, '%Y-%m');

猜你喜欢

转载自blog.csdn.net/asd521a65sdf12/article/details/121330135
今日推荐