× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



>I need to count the number of people for each
>age that work within the company

An alternative to arrays is SQL:
select age,count(*) from ... group by age order by 1
fetch each record and do what you need.

Arrays have an advantage if you need to know what ages are not present in
your dataset - the element will be zero.  SQL has an advantage if you need
to do the same sort of calculation on a very diverse dataset like postal
code, where the number of elements would be impractical without developing a
hash function.  It also has an advantage in that you can readily sort the
results by descending count viz.: order by 2 desc.

Buck Calabro
Commsoft; Albany, NY
Visit the Midrange archives and FAQ at http://www.midrange.com
"As a rule, men worry more about what they can't see than
 about what they can." -- Julius Caesar


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.