Re: Array questions
John Barleycorn wrote:
Hi
I have a 1D array, populated with a list of values extracted from a
SQL database.
I would like to be able to report on the number of unique values in
the column together with a count of each of these values.
Can't seem to find out how to extract the data in this way - can
anyone help me out, please?
You pretty much have to go through the list and count them up. Any "magic" way
of doing it would just be doing that for you. If you want the database to do it
for you, you can do "Select ValueField, Count(*) As ValueCount From TheTable
Group By ValueField". To do it yourself, make an array to hold the unique
values, and another to hold the counts. Go through the main list, check if each
value is in the unique list, add it if it is not, or increment its count if it
is.
.
Relevant Pages
- Array questions
... I have a 1D array, populated with a list of values extracted from a SQL database. ... I would like to be able to report on the number of unique values in the column together with a count of each of these values. ... Can't seem to find out how to extract the data in this way - can anyone help me out, ... (microsoft.public.vb.general.discussion) - Re: how to return mulitple corresponding values
... This will extract the dates in ascending order, oldest to newest, that meet ... I'm leaving out the sheet name so be sure to add it to your formula. ... Array entered**: ... If you're not using dynamic named ranges then I would "dummy down" ... (microsoft.public.excel.worksheet.functions) - Re: [PHP] Dynamic dropdown lists (select)
... First, if I got this correct, you can extract the makes select-element from ... The next thing is writing down a js code, that contains an array of models ... Im thinking maybe AJAX ... im not a fan of this technique on full-blown web browsers, ... (php.general) - Copying an array slice (Was: Re: Difficulties with passing multi-dimensional arrays)
... to extract an arbitrary-size slice from an arbitrary-size 2D array and I ... perhaps compiler optimisations would remove that seeming benefit - I know ... (comp.lang.c) - Newbie: Array of pointers to strings questions.
... What I'm trying to do is extract information from one file and insert ... and the information in each case is extracted as a string. ... the relevant file is read into a temp file, ... but handling the array was a problem. ... (comp.lang.c) |
|