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');