Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion help with query please ?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Spokey Wheeler Gmail  
View profile  
 More options May 9 2012, 8:50 am
Newsgroups: comp.databases.informix
From: Spokey Wheeler Gmail <spokey.whee...@gmail.com>
Date: Wed, 9 May 2012 13:50:25 +0100
Local: Wed, May 9 2012 8:50 am
Subject: Re: help with query please ?
Something like:

select first_name || last_name as wholename, count(*) as ccount
from club_members
group by 1
into temp tccount;

select count(wholename), ccount
from tccount
group by 2
order by 2;

Or you could do something like

select count(wholename), ccount
from (
select first_name || last_name as wholename, count(*) as ccount
from club_members
group by 1
)
group by 2
order by 2;

Not tested either one.

Not sure how you're going to cope with students who aren't in any clubs.

On 9 May 2012, at 13:11, Floyd Wellershaus wrote:

> I have a table called club_members. It has 3 columns first_name,last_name,club_name

> Write a query to summarize how many clubs each student is in.  The Dean wants a concise report so consolidate it to show just the count of students based on the number of clubs they are in.

> Sample report (your numbers and basic styling may differ)

> students, clubs_per_student

> 600, 0

> 300, 1

> 200, 2

> ...

> I've tried and can't get a handle around this one. Any help would be greatly appreciated.

> Thanks,
> floyd

> Floyd Wellershaus
> Dba/Sa Informix/Oracle/Linux/Aix

> http://www.linkedin.com/in/floydwellershaus
> http://photos.fwellers.com
> ========================================================
> _______________________________________________
> Informix-list mailing list
> Informix-l...@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.