List:General Discussion« Previous MessageNext Message »
From:Rob Date:May 27 2003 8:42am
Subject:group by
View as plain text  
Hi all,

I have a question regarding group by.  Is it possible to group by "bands"?
What I mean is this.  Say I have the following table:

ID | Age | Name
---------------
1  | 30  | Rob
1  | 12  | John
1  | 13  | James
1  | 14  | John
1  | 32  | Rob
1  | 33  | John
1  | 34  | Rob
1  | 67  | John
1  | 68  | John

Say now I want a count of names grouped by name and by, NOT AGE, but age
groups i.e. 0 - 14, 15 - 29, etc., so I should get an answer like

Age		Name		Count

0 - 14	John		2
0 - 14	James		1
15 - 29	-		-
30 - 45	Rob		3

etc.

Is this possible?


---
Rob

**************************
Rob Cherry
mailto:rob@stripped
+27 21 447 7440
Jam Warehouse RSA
Smart Business Innovation
http://www.jamwarehouse.com
**************************



All information contained in this email is confidential and may be used by the intended
recipient only.

Thread
group byRob27 May
  • Re: group byJose Miguel Pérez27 May
    • RE: group byRob27 May
    • Re: group byJon Haugsand27 May
    • Re: group byDon Read27 May
  • Re: group byJose Miguel Pérez27 May
    • Re: group byJon Haugsand27 May
  • Re: group byJose Miguel Pérez27 May
    • Re: group byJon Haugsand27 May
  • Re: group byJose Miguel Pérez27 May