Hmm, sounds interesting, but isn't that assuming that I know how many
elements are in the second column (month) of the resultset?  And that the
query is hard-coded to expect that result?  Is there a way to do it if the
number/names of the elements in the second column is unknown?

----- Original Message -----
From: "Troy Sosamon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 18, 2003 4:33 PM
Subject: RE: Witango-Talk: Array Manipulation Puzzle


> Do a direct dbms command using a select and a group by something like
this:
>
> select name, (sum((ifeq(month, 'jan', count, 0)))) as Jan,
(sum((ifeq(month,
> 'Feb', count, 0)))) as Feb, ......
>   from mytable group by Name
>
> Troy
>
> -----Original Message-----
> From: Dave Machin [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 18, 2003 5:14 PM
> To: [EMAIL PROTECTED]
> Subject: Witango-Talk: Array Manipulation Puzzle
>
>
> I have many queries that return results like this:
>
> Name    Month    Count
> Fred    Jan    50
> Wilma    Jan    32
> Barney    Jan    33
> Betty    Jan    30
> Fred    Feb    60
> Wilma    Feb    42
> Barney    Feb    43
> Betty    Feb    40
> Fred    Mar    40
> Wilma    Mar    22
> Barney    Mar    23
> Betty    Mar    20
>
> etc...
>
> I often need to convert that into a table or array that looks like this:
>
> Name    Jan    Feb    Mar
> Fred    50    60    40
> Wilma    32    42    22
> Barney    33    43    23
> Betty    30    40    20
>
> What is the simplest/fastest way to do that conversion?
>
> Dave Machin
>
>
> E-Mail. [EMAIL PROTECTED]
> Tel.  805.614.0123 x 30
> Address: 3130 Skyway Drive #702
> Santa Maria, CA 93455
>
> ________________________________________________________________________
> TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
>
> ________________________________________________________________________
> TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
>
>


________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf

Reply via email to