Counting... Averaging....

Results 1 to 3 of 3

Thread: Counting... Averaging....

  1. #1
    Join Date
    Dec 1969

    Default Counting... Averaging....

    Hello.. I have 62 fields in a database.. All have a number 0-5 in them. What&#039;s the best way to tally up the following information:<BR><BR>How many records have either a 0, 1, 2, 3, 4, or 5.<BR>What is the average number of all the records.<BR><BR>Thanks for your help.<BR><BR>dep<BR>

  2. #2
    Join Date
    Dec 1969

    Default fields or records???

    Do you *really* have 62 fields in *each* record???<BR><BR>To say the least, *that* will be a pain to do, because SQL makes you specify each field separately.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Counting... Averaging....

    (I assume you mean records instead of fields)<BR><BR>SELECT field, COUNT(field) as Count FROM theTable<BR>GROUP BY field<BR>COMPUTE AVG(field)

Posting Permissions

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