How to do sum of column when there is 1million records
How to get sum of column soon when there is 1million records or than that in the table?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Andrew FensterPosted Jun 13, 2011, 9:49 AM
select SUM(sale_price)
from sales
where store_id = 57
If you have millions of records, you might need to put an index on the store_id column to improve performance.
Mahesh ChandPosted Jun 11, 2011, 8:47 AM
Vijay YadavPosted Jun 11, 2011, 4:18 AM
I mean to ask it will take more time to fetch the record from millions of record?
Andrew FensterPosted Jun 10, 2011, 11:58 AM
select SUM(sale_price) from sales
The database can do this kind of thing very efficiently.
Guest UserPosted Jun 10, 2011, 8:25 AM
Otherwise you can use a partitioned view which logically splits a large table into smaller tables.
Suthish NairPosted Jun 10, 2011, 8:18 AM