对于上了百万的记录,当使用select sum(列) from table1 where pkid='kkkkkk'
时耗时80ms.pkid是建有索引,在SQL2005情况下,可以使用它的新的特性来降低这个时间,但在sql2000下如何来处理呢.
thanks
------解决方案--------------------
- SQL code
select sum(列) from tb where pkid='kkkkkk' GROUP BY pkid WITH ROLLUP
select sum(列) from tb where pkid='kkkkkk' GROUP BY pkid WITH ROLLUP