Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Summary query (Everquest related!)

Summary query (Everquest related!)

From: BVince2172 <bvince2172_at_aol.comPRO>
Date: 22 Aug 2002 12:38:46 GMT
Message-ID: <20020822083846.11587.00002234@mb-mm.aol.com>


I've spent far too long trying to work this SQL out, but I'm convinced there's a 'neat' solution to it.

My dilemma is this, using the following tables:

ECHELON



echelon_id (number) (primary key)
name (varchar2)

CHARACTER



character_id (number) (primary key)
level (number)
echelon_id

Ok. Only for those echelons where there is at least 2 members (ie. COUNT(echelon_id) in Character is >= 2) I want to list the total number of characters in that echelon and how many characters in that echelon have levels in the the following ranges: <20 20 to 29 30 to 49 >=50

I'm hoping to get results something like this:

echelon_id name characters <20 20-29 30-49 >=50


1                 GRACE      3                 1      0         2         0
4                 SHADOW   2                 0      0         0         2
10               CONFLICT  10                2     5         1         2


I've been bashing my head against a wall since I'm relatively new to this. Anyone give me a pointer?

Thanks,
Ben Received on Thu Aug 22 2002 - 07:38:46 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US