count的几种情况

    技术2022-05-19  32

    --第一种select count(*from tablename--第二种select count(ID) from tablename--第三种,1换成其它值也是可以的select count(1from tablename/*--第四种,这个不存在性能问题idint 表ID(如果 indid = 0 或255)。否则为索引所属表的IDIndid smallint 索引ID:0=表1=聚簇索引>1=非聚簇索引255=具有text或image数据的表条目。rows int 基于indid=0 和 indid=1地数据级行数,该值对于indid>1重复。如果indid=255,rows设置为0。当表没有聚簇索引时,Indid = 0 否则为 1。 */select rows,indid from sysindexes where id = object_id('tablename'and indid in (0,1


    最新回复(0)