Several 'counts' in same query

Results 1 to 2 of 2

Thread: Several 'counts' in same query

  1. #1
    Tomo Guest

    Default Several 'counts' in same query

    Any ideas on getting 6 &#039;counts&#039; from a large table (100000+) v quickly?<BR><BR>I have to extract several levels of stats from a &#039;messages&#039; table for an individual user. I am using a stored procedure to store the relevant users messages in a temp table then doing select count for today, yesterday, last week, last month etc, along the lines of the 4guys article re &#039;paging recs with a sproc&#039;. This does not seem to speed my ASP up - I thought this would be quicker than going thru the whole table for every individual count. Am I just doing work that SQL Server does transparently anyway? (The messageID and userID are both indexed).<BR><BR>Any ideas?

  2. #2
    Join Date
    Dec 1969

    Default Post your Question on Databases Q&A


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts