SELECT o.name AS "Table Name", i.rowcnt AS "Row Count"
FROM sysobjects o, sysindexes i
WHERE i.id = o.id
AND i.indid IN(0,1)
AND o.xtype = 'u' --只统计用户表
AND o.name <> 'sysdiagrams'
ORDER BY i.rowcnt DESC --按行排降序
如何提高sql查询100万条数据count(*)汇总的速度
最新推荐文章于 2024-06-28 23:16:20 发布